JamesWayne
New Member
- Joined
- Sep 6, 2017
- Messages
- 15
Hi All
I'm currently using some VBA to hide rows based on value in a cell and what I would like to do is apply that code to a range of worksheets in the workbook, how would I go about this.
Lets say the worksheet names are called Month1, Month2, Month3 etc through to Month12.
This is my code:
Set rng = Range("A5:A90")
For Each cel In rng
If cel.Value = 0 Then
cel.EntireRow.Hidden = True
ElseIf cel.Value = 1 Then
cel.EntireRow.Hidden = False
End If
Next cel
Thank you
I'm currently using some VBA to hide rows based on value in a cell and what I would like to do is apply that code to a range of worksheets in the workbook, how would I go about this.
Lets say the worksheet names are called Month1, Month2, Month3 etc through to Month12.
This is my code:
Set rng = Range("A5:A90")
For Each cel In rng
If cel.Value = 0 Then
cel.EntireRow.Hidden = True
ElseIf cel.Value = 1 Then
cel.EntireRow.Hidden = False
End If
Next cel
Thank you