Hi Gurus,
I have a stomper. I am trying to hide/unhide columns based on three different drop down lists. The below formula works to hide/unhide when individual drop down lists are selected, however does not work together to "filter down" and show only the columns that apply when all three drop downs are selected.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Fnd As Range
If Target.Address(0, 0) = "C3" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F9:JY9")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
If Target.Address(0, 0) = "C5" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F10:JY10")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
If Target.Address(0, 0) = "C7" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F11:JY11")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
For example, if in the drop down I have 1) Vendors, 2) Countries, and 3) Type, I want to be able to hide all the columns except what are selected in drop downs 1-3. Alternatively, I would like to pick only 3) Type and not have to selected 1) Vendors and 2) Countries for this to work.
Hope this makes sense. Any help is greatly appreciated!
Thanks!
Novice
I have a stomper. I am trying to hide/unhide columns based on three different drop down lists. The below formula works to hide/unhide when individual drop down lists are selected, however does not work together to "filter down" and show only the columns that apply when all three drop downs are selected.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Fnd As Range
If Target.Address(0, 0) = "C3" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F9:JY9")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
If Target.Address(0, 0) = "C5" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F10:JY10")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
If Target.Address(0, 0) = "C7" Then
If Target.Value = "" Then
Range("F:JY").EntireColumn.Hidden = False
Else
For Each Cl In Range("F11:JY11")
Cl.EntireColumn.Hidden = Cl.Value <> Target.Value
Next Cl
End If
End If
For example, if in the drop down I have 1) Vendors, 2) Countries, and 3) Type, I want to be able to hide all the columns except what are selected in drop downs 1-3. Alternatively, I would like to pick only 3) Type and not have to selected 1) Vendors and 2) Countries for this to work.
Hope this makes sense. Any help is greatly appreciated!
Thanks!
Novice