Code:
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Range("H2"), Target) Is Nothing Then
If Worksheets("2016!").Range("h2") = "SIS" Then
Range("P:U").EntireColumn.Hidden = True
Range("V:AA").EntireColomn.Hidden = False 'this line gives a runtime error 438
End If
End If
End Sub
There is a drop-down list in h2 with three options. "SIS" should hide the first range, but show the second range. Than "AGP" should show the first range, but hide the second range and "AA" should show both ranges. Can someone help me with this?