Hello All,
I'm brand new here and pretty new to Macros in general and I'm coming up on this error and cannot figure out what I'm doing wrong.
What I have set up is below, it all works just fine BUT, if I click delete on my keyboard to clear the contents of the reference cell, I get this error message.
The cell that this is looking at has a drop down menu of items to select. I have this exact coding in another sheet in my workbook and I am not getting this error message there.
Here is the code I'm using
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("G17"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
'Salary Section - Show and Hide Code
Case Is = "Yes": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
Case Is = "No": Rows("42:204").EntireRow.Hidden = True
Rows("205:365").EntireRow.Hidden = True
Case Is = "": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
Case Is = " ": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
End Select
End If
End Sub
Any ideas??
Thanks!
I'm brand new here and pretty new to Macros in general and I'm coming up on this error and cannot figure out what I'm doing wrong.
What I have set up is below, it all works just fine BUT, if I click delete on my keyboard to clear the contents of the reference cell, I get this error message.
The cell that this is looking at has a drop down menu of items to select. I have this exact coding in another sheet in my workbook and I am not getting this error message there.
Here is the code I'm using
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("G17"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
'Salary Section - Show and Hide Code
Case Is = "Yes": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
Case Is = "No": Rows("42:204").EntireRow.Hidden = True
Rows("205:365").EntireRow.Hidden = True
Case Is = "": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
Case Is = " ": Rows("42:204").EntireRow.Hidden = False
Rows("205:365").EntireRow.Hidden = True
End Select
End If
End Sub
Any ideas??
Thanks!