Excel Newcomer
New Member
Hi,
I am trying to hide/unhide rows based on a cell answer. In my case, Rows 11-15 begin unhidden. with 16 onward hidden. H11-H14 are free form. When H15 is "yes" I want rows 16-20 to show, where H20 is the next "yes" or "no" cell, 16-19 being free form, and so on. (If H15 is "No", nothing happens). My current code is as follows:
and the excel page snapshot is attached. How do I go about including the 4 cells in between 16 and 20?
Thank you
I am trying to hide/unhide rows based on a cell answer. In my case, Rows 11-15 begin unhidden. with 16 onward hidden. H11-H14 are free form. When H15 is "yes" I want rows 16-20 to show, where H20 is the next "yes" or "no" cell, 16-19 being free form, and so on. (If H15 is "No", nothing happens). My current code is as follows:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then
For Each cel In Target
Call Worksheet_Change(cel)
Next cel
End If
If Target.Column = 8 Then
If LCase(Target.Value) = LCase(Target.Offset(, 3)) Then
Cells(Target.Offset(, 4), 1).EntireRow.Hidden = False
Else
Cells(Target.Offset(, 4), 1).EntireRow.Hidden = True
End If
End If
End Sub
and the excel page snapshot is attached. How do I go about including the 4 cells in between 16 and 20?
Thank you