Hello,
I'm trying to create a selection tool when based on the criteria selected more rows become un-hidden. So far I have the below for my code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'For On Property'
If Range("C7").Value = "YES" And Range("F7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = False
'For Above_Property- Drops down Company_Level'
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" And Range("F13").Value = "Division" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
Rows("14:16").EntireRow.Hidden = False
Else
Rows("9:29").EntireRow.Hidden = True
End If
End Sub
Everything works up until the user has to select Division. Once Division is chosen in the Box Rows 14:16 do not unhide. The process would keep going because cell F13 can also contain Region, in the case of Rows 18:19 would then unhide.
Please help me out. I'm not sure why it is not unhiding the second set of cells.
I'm trying to create a selection tool when based on the criteria selected more rows become un-hidden. So far I have the below for my code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'For On Property'
If Range("C7").Value = "YES" And Range("F7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = False
'For Above_Property- Drops down Company_Level'
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
ElseIf Range("F7").Value = "YES" And Range("C7").Value = "NO" And Range("F13").Value = "Division" Then
Rows("9:10").EntireRow.Hidden = True
Rows("12:13").EntireRow.Hidden = False
Rows("14:16").EntireRow.Hidden = False
Else
Rows("9:29").EntireRow.Hidden = True
End If
End Sub
Everything works up until the user has to select Division. Once Division is chosen in the Box Rows 14:16 do not unhide. The process would keep going because cell F13 can also contain Region, in the case of Rows 18:19 would then unhide.
Please help me out. I'm not sure why it is not unhiding the second set of cells.