Hi All,
I am attempting to select from a drop down list and based on the selection I wish to hide the columns that are not relevant.
This is the code that I'm using however am not getting any changes what so ever.
Any suggestions would be amazing thank you.
I am attempting to select from a drop down list and based on the selection I wish to hide the columns that are not relevant.
This is the code that I'm using however am not getting any changes what so ever.
Any suggestions would be amazing thank you.
VBA Code:
Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
ActiveSheet.Activate
If Not Application.Intersect(Range("M3"), Range(Target.Address)) Is Nothing Then
Select Case Target.Value
Case Is = "Show_All": Columns("I:L").EntireColumn.Hidden = False
Columns("E:H").EntireColumn.Hidden = False
Case Is = "Powerlink": Columns("AK:AV").EntireColumn.Hidden = False
Columns("AG:AJ").EntireColumn.Hidden = True
Case Is = "Transgrid": Columns("AG:AJ").EntireColumn.Hidden = False
Columns("AK:AV").EntireColumn.Hidden = True
Case Is = "Electranet": Columns("I:L").EntireColumn.Hidden = False
Columns("E:H").EntireColumn.Hidden = False
End Select
End If
ActiveSheet.Protect
End Sub