Hide/Unhide Rows in Excel in multiple sheets

New Contributor
I have a data in more than 40 sheets with same format. In "Column AX", I have total of all. Data format:- "top to bottom is date amd left to right is brands". In Column AX top to bottom is total of all brands. I want to hide those rows at once who has 'Zero' values in rows. How can I do in multiple sheets at once.
6 Replies


Whether the following macro works or not depends on the layout of your worksheets...



Sub HideZeros()
    Dim wsh As Worksheet
    For Each wsh In Worksheets
        Select Case wsh.Name
            ' List the exceptions here, if any
            Case "Introduction", "Summary"
                ' Skip these sheets
            Case Else
                wsh.UsedRange.AutoFilter Field:=50, Criteria1:="<>0"
        End Select
    Next wsh
End Sub


best response confirmed by SomeshKaistha (New Contributor)
Thanks. I'll check & let you know whether it works for me or not.
Nott working for me
Issue is still there. Code not working for me


Please attach a sample workbook without sensitive data.


Personally, I would modify @Hans Vogelaar 's code to delete the rows, rather than filtering them, and then convert all the tabular data to Excel tables that resize to accommodate the actual content.