Happy New Year! I feel I'm close but getting an Run-Time '1004": error message. "Unable to Set the Hidden property of the Range class."
I want to SHOW rows 25:33 if the G23 says "Yes", if it says anything else, I want rows 25:33 to be HIDDEN.
I feel I'm close but need a bit of tweaking. Please help...THANKS!
I want to SHOW rows 25:33 if the G23 says "Yes", if it says anything else, I want rows 25:33 to be HIDDEN.
I feel I'm close but need a bit of tweaking. Please help...THANKS!
VBA Code:
Private Sub worksheet_change(ByVal target As Range)
Dim KeyCells As Range
Set KeyCells = Range("G23")
If Not Application.Intersect(KeyCells, Range(target.Address)) Is Nothing Then
If KeyCells = "Yes" Then
Rows("25:33").Hidden = False
Else
Rows("25:33").Hidden = True
End If
End If
End Sub
Last edited by a moderator: