I am attempting to hide columns based on the selection made in a drop down list in B1. There are five options, four of which would result in certain columns hiding. "Select" hides all relevant columns, "Whites", "Colors" and "Grays" hide certain columns, and "Various" hides no columns. Changes apply to this worksheet only. Below is the code I have entered in my VBA. All Macros are enabled. What is wrong with it?!
Private Sub Worksheet_Change (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Colors" Then
Columns("E:L").EntireColumn.Hidden = True
Else
Columns("E:L").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change1 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Grays" Then
Columns("E:H").EntireColumn.Hidden = True
Columns("M:P").EntireColumn.Hidden = True
Else
Columns("E:H").EntireColumn.Hidden = False
Columns("M:P").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change2 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Whites" Then
Columns("I:P").EntireColumn.Hidden = True
Else
Columns("I:P").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change3 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Select" Then
Columns("E:P").EntireColumn.Hidden = True
Else
Columns("E:P").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Colors" Then
Columns("E:L").EntireColumn.Hidden = True
Else
Columns("E:L").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change1 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Grays" Then
Columns("E:H").EntireColumn.Hidden = True
Columns("M:P").EntireColumn.Hidden = True
Else
Columns("E:H").EntireColumn.Hidden = False
Columns("M:P").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change2 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Whites" Then
Columns("I:P").EntireColumn.Hidden = True
Else
Columns("I:P").EntireColumn.Hidden = False
End If
End If
End Sub
Private Sub Worksheet_Change3 (ByVal Target As Range)
If Target.Address = "$B$1" Then
If UCase(Target) = "Select" Then
Columns("E:P").EntireColumn.Hidden = True
Else
Columns("E:P").EntireColumn.Hidden = False
End If
End If
End Sub