ArbiterWolf
New Member
- Joined
- Jan 15, 2022
- Messages
- 19
- Office Version
- 2016
- Platform
- Windows
I have a excel workbook with about 60 sheets. I have a sheet that you input page numbers into and it separates the info onto the different sheets depending on the different info tied to particular page numbers. So I have a "Total" qty # of pages on every sheet. I would like to have all the sheets hidden until the total is >0.
So I currently have this code on the sheet you input the info on.
Sub Worksheet_Change(ByVal Target As Range)
Application.Volatile
If Sheet5.Range("C58").Value > 0 Then
Sheet5.Visible = True
Else
Sheet5.Visible = False
End If
End Sub
And it works exactly how I want it but what I want to know is if there is a easier way to apply this code to all the sheets? Or do I have to copy this code 60+ times for each individual sheet?
So the "total" cell is in the same cell for the first 20 sheets then in the same for the rest. 1-20 its C58 21-60 its E60.
So I currently have this code on the sheet you input the info on.
Sub Worksheet_Change(ByVal Target As Range)
Application.Volatile
If Sheet5.Range("C58").Value > 0 Then
Sheet5.Visible = True
Else
Sheet5.Visible = False
End If
End Sub
And it works exactly how I want it but what I want to know is if there is a easier way to apply this code to all the sheets? Or do I have to copy this code 60+ times for each individual sheet?
So the "total" cell is in the same cell for the first 20 sheets then in the same for the rest. 1-20 its C58 21-60 its E60.