I am trying to write a code that will hide/unhide rows based on drop down values. I can get the first drop down LLknownunknown to work just fine, but all the other drop downs don't work. Each drop down is named correctly and each row number is correct, so I am now sure what is going on.
So when LLknownunknown changes, the correct rows will hide/unhide. When KnownUnknown or Zeroknownunknown change, nothing happens. Each one will need to work independently.
Any thoughts? I triple checked and the cell names are correct.
Private Sub Worksheet_Change(ByVal Target As Range)
'The follow code will hide and unhide the Load Loss cell based on the user selection
If Intersect(Target, Range("LLknownunknown")) Is Nothing Or Target.Cells.Count > 1 Then
Exit Sub
ElseIf Range("LLknownunknown").Value = "Yes" Then
Rows("14:15").EntireRow.Hidden = False
ElseIf Range("LLknownunknown").Value = "No" Then
Rows("14:15").EntireRow.Hidden = True
End If
'The follow code will hide and unhide the impedance cells based on the user selection
If Intersect(Target, Range("KnownUnknown")) Is Nothing Or Target.Cells.Count > 1 Then
Exit Sub
ElseIf Range("KnownUnknown").Value = "Yes" Then
Rows("21:30").EntireRow.Hidden = False
Rows("36:52").EntireRow.Hidden = True
ElseIf Range("KnownUnknown").Value = "No" Then
Rows("21:30").EntireRow.Hidden = True
Rows("36:52").EntireRow.Hidden = False
End If
'The follow code will hide and unhide the zero sequence cells based on the user selection
If Intersect(Target, Range("Zeroknownunknown")) Is Nothing Or Target.Cells.Count > 1 Then
Exit Sub
ElseIf Range("Zeroknownunknown").Value = "Yes" Then
Rows("31:35").EntireRow.Hidden = False
Rows("53:61").EntireRow.Hidden = True
ElseIf Range("Zeroknownunknown").Value = "No" Then
Rows("31:35").EntireRow.Hidden = True
Rows("53:61").EntireRow.Hidden = False
End If
End Sub