Forum Discussion
Hide rows based on Drop-down box selection
- Feb 04, 2026
I was able to get this to work by using the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$O$35" Then
Select Case Target.Value
Case "VPN to VPN Cloud-Based"
Rows("36:239").EntireRow.Hidden = True
Case "Please Select"
Rows("36:239").EntireRow.Hidden = False
Case "Leased Line"
Rows("36:239").EntireRow.Hidden = False
Case "Custom Network"
Rows("36:239").EntireRow.Hidden = False
Case "N/A"
Rows("36:239").EntireRow.Hidden = False
Case "Please Select:"
Rows("36:239").EntireRow.Hidden = False
End Select
End If
End Sub
Could you please share:
Your current VBA code (you can paste it as text)
Details about your dropdown:
Is it a Data Validation dropdown or an ActiveX/Form Control?
Which cell contains the dropdown?
What's the exact text of the selection options?
Additional: Which operating system?
Which Office version?
In this link you will find some more information about it:
Welcome to your Excel discussion space!
So no one needs to guess and exclude many ways/causes with a lot of communicative time.
Thank you for your understanding and patience
I know I don't know anything (Socrates)