Hello all,
First post so please bear with me. I have some vba code on a sheet that works well to hide columns based on text in a cell (eg. "Test1" hides columns B:P)
Trying to do the same for rows but with background color but not working and have tried so many variations just figured I'd pause and see if I could reach out to the community to help.
Thanks in advance for any ideas offered!
First post so please bear with me. I have some vba code on a sheet that works well to hide columns based on text in a cell (eg. "Test1" hides columns B:P)
Trying to do the same for rows but with background color but not working and have tried so many variations just figured I'd pause and see if I could reach out to the community to help.
Thanks in advance for any ideas offered!
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("Q4"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Test0":
Columns("A:ZZ").EntireColumn.Hidden = False
'Rows("5:5").EntireRow.Hidden = False
Case Is = "Test1":
Columns("Q:BH").EntireColumn.Hidden = False
Columns("B:P").EntireColumn.Hidden = True
End Select
End If
If Not Application.Intersect(Range("B7"), Range(Target.Address)) Is Nothing Then
Select Case Target.Interior.ColorIndex
Case xlNone, 10: Rows("5:5").EntireRow.Hidden = True
Case Else: Rows("5:5").EntireRow.Hidden = False
End Select
End If
End Sub