Hello there,
Looking for a bit of help at hiding rows in a sheet called "Summary" based on cell E35 in a sheet called "Basics".
I can get this to work using the code below the problem is that I will want the value to go to 100 and up to 100 rows (from row 24 on) to be hidden. WI'd also like all rows to be unhidden if E35 is blank. Would anyone have any suggestions on how this is possible using a loop function?
Thanks so much for your help!
Looking for a bit of help at hiding rows in a sheet called "Summary" based on cell E35 in a sheet called "Basics".
I can get this to work using the code below the problem is that I will want the value to go to 100 and up to 100 rows (from row 24 on) to be hidden. WI'd also like all rows to be unhidden if E35 is blank. Would anyone have any suggestions on how this is possible using a loop function?
Code:
Private Sub Worksheet_Calculate()
Dim Summaries,As Range
Set Summaries = Sheets("Basics").Range("E35")
If Summaries.Value = "1" Then
Sheets("Summary").Rows("23:23").EntireRow.Hidden = False
Sheets("Summary").Rows("24:32").EntireRow.Hidden = True
ElseIf Summaries.Value = "2" Then
Sheets("Summary").Rows("23:24").EntireRow.Hidden = False
Sheets("Summary").Rows("25:32").EntireRow.Hidden = True
ElseIf Summaries.Value = "3" Then
Sheets("Summary").Rows("23:25").EntireRow.Hidden = False
Sheets("Summary").Rows("26:32").EntireRow.Hidden = True
Else
Sheets("Summary").Rows("23:32").EntireRow.Hidden = False
End If
End Sub
Thanks so much for your help!