Can someone please help me with the below code:
Private Sub Worksheet_Change(ByVal Target As Range)
With Sheets("Sheet2")
Select Case Target.Address(False, False)
Case "B12"
.Rows(14).Rows.Hidden = Target.Value = ""
.Rows(34).Rows.Hidden = Target.Value = ""
.Rows(37).Rows.Hidden = Target.Value = ""
Case "B13"
.Rows(15).Rows.Hidden = Target.Value = ""
.Rows(35).Rows.Hidden = Target.Value = ""
.Rows(38).Rows.Hidden = Target.Value = ""
End Select
End With
End Sub
I need to change it so that it hides a range of rows, say (6:26) instead of adding a line of code for each of the rows from 6 to 26 that I want to hide
Also how can I go about hiding the same rows on 5 more sheets, can I add more sheetnames after "Sheet2"?
Thanks,
Mike
Private Sub Worksheet_Change(ByVal Target As Range)
With Sheets("Sheet2")
Select Case Target.Address(False, False)
Case "B12"
.Rows(14).Rows.Hidden = Target.Value = ""
.Rows(34).Rows.Hidden = Target.Value = ""
.Rows(37).Rows.Hidden = Target.Value = ""
Case "B13"
.Rows(15).Rows.Hidden = Target.Value = ""
.Rows(35).Rows.Hidden = Target.Value = ""
.Rows(38).Rows.Hidden = Target.Value = ""
End Select
End With
End Sub
I need to change it so that it hides a range of rows, say (6:26) instead of adding a line of code for each of the rows from 6 to 26 that I want to hide
Also how can I go about hiding the same rows on 5 more sheets, can I add more sheetnames after "Sheet2"?
Thanks,
Mike