Link to home
Start Free TrialLog in
Avatar of Flip011
Flip011

asked on

How do you Show/Hide Rows based on Dropdown selection?

How do you Show/Hide Rows based on Dropdown selection?
 User generated image
ASKER CERTIFIED SOLUTION
Avatar of NBVC
NBVC
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
use this code:


Private Sub Worksheet_Change(ByVal Target As Range)
Dim row As Double
Dim hide As Boolean
      
    If Target.Address = "$B$1" Then
        For row = 4 To UsedRange.Rows.Count
            hide = True
            If Cells(row, 1) = "Plan " & Target Then hide = False
            If Cells(row, 2) = "Plan " & Target Then hide = False
            If Cells(row, 3) = "Plan " & Target Then hide = False
            Rows(row).Hidden = hide
        Next row
    End If

End Sub

Open in new window


as in
example.xlsm