Hi, I need help with hiding rows based on some yes/no questions. So I have questions and their answers are at cells: B6, B16 and B20, and all of them have an yes/no option and based on their answer rows 28:29 should be hidden, but it should only be hidden if all of the cells say no.
I have been using the following code that works but only if I am referencing one cell but I want to be able to link B16 and B20 as well.
All help would be greatly appreciated
I have been using the following code that works but only if I am referencing one cell but I want to be able to link B16 and B20 as well.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Activate
If Target.Address = "$B$6" Then
Select Case Target.Value
Case Is = "Yes":
Rows("28:29").EntireRow.Hidden = True
Rows("28:29").EntireRow.Hidden = False
Case Is = "No":
Rows("28:29").EntireRow.Hidden = False
Rows("28:29").EntireRow.Hidden = True
End Select
End If
End Sub
All help would be greatly appreciated