I have a worksheet I use for conferences to estimate travel costs for attendees. On the first worksheet I have a list of all attendees and based on what type of employee they are, it populates different worksheets in the workbook. There is a possible 400 attendees but i need the worksheets to hide the rows if there are not that many, ie if there is 10 type A employees rows 11-400 are hidden. Currently I have
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
Rows("7:400").Hidden = (Target.Value = "0")
Rows("8:400").Hidden = (Target.Value = "1")
etc.
End If
End Sub
Is there a way to loop this so I do not have to input 400 lines of code?
Also, is there a way to check the target cell every time the page is open so if like before there was 10 type A people and someone was added to the original worksheet that this page, when clicked on, would unhide the correct rows?
Thanks
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$5" Then
Rows("7:400").Hidden = (Target.Value = "0")
Rows("8:400").Hidden = (Target.Value = "1")
etc.
End If
End Sub
Is there a way to loop this so I do not have to input 400 lines of code?
Also, is there a way to check the target cell every time the page is open so if like before there was 10 type A people and someone was added to the original worksheet that this page, when clicked on, would unhide the correct rows?
Thanks