Forum Discussion

SomeshKaistha's avatar
SomeshKaistha
Copper Contributor
Sep 19, 2021
Solved

Hide/Unhide Rows in Excel in multiple sheets

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

  • SomeshKaistha 

    Personally, I would modify HansVogelaar '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.

  • SomeshKaistha 

    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

     

Resources