I got to know to hide basic rows as screenshot: When I select 1 it hides rows 9-14 and so on.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim TrigerCell As Range
Set Triggercell = Range("D2")
If Not Application.Intersect(Triggercell, Target) Is Nothing Then
If Triggercell.Value = 1 Then
Rows("9:14").Hidden = False
Rows("11:14").Hidden = True
ElseIf Triggercell.Value = 2 Then
Rows("9:14").Hidden = False
Rows("13:14").Hidden = True
ElseIf Triggercell.Value = 3 Then
Rows("9:14").Hidden = False
End If
End If
End Sub
But what if I have multiple columns with the same name? How can I conceal the rows of screenshots below? Due to the lack of a distinct cell like the one above D2. If I choose options 1, 2, and 3, I want to hide rows 27 through 36 and then reveal those same rows when I choose option 3.