Macro Adjustment for Unhiding Rows

tommychowdah

New Member
Joined
Dec 26, 2017
Messages
31
Hi!

Would someone be able to adjust this macro to unhide all rows?

Code:
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 by a moderator:

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Not sure if this is what you want, but it will unhide all rows, before hiding those containing 1 in col ZZ
Code:
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
        ws.Cells.EntireRow.Hidden = False
        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
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top