Paynter3420
New Member
- Joined
- Jun 7, 2016
- Messages
- 5
Hello all! I have two worksheets. The First one "BS1" and the second "PL2." On the first one, I've created a macro that hides certain columns in BS1 if cell L6 says "Single Year" "Comparative" or "Quarterly Comparative." The code is below for this.
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("L5"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Single Year": Columns("F:G").EntireColumn.Hidden = True
Columns("A:E").EntireColumn.Hidden = False
Case Is = "Comparative": Columns("F:G").EntireColumn.Hidden = False
Columns("A:E").EntireColumn.Hidden = False
Case Is = "Quarterly Comparative": Columns("F:G").EntireColumn.Hidden = False
Columns("A:E").EntireColumn.Hidden = False
End Select
End If
End Sub
Now, I'd like to add another macro or modify this macro so that columns F & G will be hidden on "PL2" if the same selections are made.
Thanks for your help!
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Not Application.Intersect(Range("L5"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Single Year": Columns("F:G").EntireColumn.Hidden = True
Columns("A:E").EntireColumn.Hidden = False
Case Is = "Comparative": Columns("F:G").EntireColumn.Hidden = False
Columns("A:E").EntireColumn.Hidden = False
Case Is = "Quarterly Comparative": Columns("F:G").EntireColumn.Hidden = False
Columns("A:E").EntireColumn.Hidden = False
End Select
End If
End Sub
Now, I'd like to add another macro or modify this macro so that columns F & G will be hidden on "PL2" if the same selections are made.
Thanks for your help!