I have a userform that I need to have open when a blank cell in Range ("A8:A51") is selected, but I don't need the userform to appear if the cell selected in Range("A8:A51") already has a value or text in it.
The code I have now works but when I select any other cell on the sheet outside my range I get a Run-time error "91' Object variable or With block variable not set.
Here is my code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A8:A51")).Value <> "" Then
If Target.Value = "" Then
Application.EnableEvents = False
Application.ScreenUpdating = False
WorkSheet1_Form.Show
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End If
End Sub
I have tried a couple different scenarios but can't seem to figure it out. Any advice??
Thanks
Bookmarks