Forum Discussion

mzeller1776's avatar
mzeller1776
Brass Contributor
Jan 29, 2026
Solved

Hide rows based on Drop-down box selection

Hello, I have a drop-down box with different selections. One of which is "VPN to VPN Cloud-Based". If this is selected then I want to hide rows 36 through 239. Doing something wrong in my code, as i...
  • mzeller1776's avatar
    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