tommychowdah
New Member
- Joined
- Dec 26, 2017
- Messages
- 31
Hi!
I would like to adjust this macro so that instead of being applied to every sheet, it looks up a range of tab names, and is only applied to those tabs. Any help would be much appreciated!
Sub Hide_All_Rows()
Dim r As Range
Dim ws As Worksheet
On Error GoTo err_handler
Application.ScreenUpdating = False
For Each ws In Worksheets
For Each r In ws.Range("ZZ1:ZZ1000")
If r.Value = 1 Then
r.EntireRow.Hidden = True
End If
Next r
Next ws
Application.ScreenUpdating = True
Exit Sub
err_handler:
MsgBox "Sheet: " & ws.Name & " caused an error"
End Sub
I would like to adjust this macro so that instead of being applied to every sheet, it looks up a range of tab names, and is only applied to those tabs. Any help would be much appreciated!
Sub Hide_All_Rows()
Dim r As Range
Dim ws As Worksheet
On Error GoTo err_handler
Application.ScreenUpdating = False
For Each ws In Worksheets
For Each r In ws.Range("ZZ1:ZZ1000")
If r.Value = 1 Then
r.EntireRow.Hidden = True
End If
Next r
Next ws
Application.ScreenUpdating = True
Exit Sub
err_handler:
MsgBox "Sheet: " & ws.Name & " caused an error"
End Sub
Last edited: