Results 1 to 4 of 4

How do I hide rows in a range with a zero total?

This is a discussion on How do I hide rows in a range with a zero total? within the Excel Questions forums, part of the Question Forums category; In other words I have a range of rows (a23:s58) with data across columns and each row has a column ...

  1. #1
    New Member
    Join Date
    May 2003
    Posts
    2

    Default How do I hide rows in a range with a zero total?

    In other words I have a range of rows (a23:s58) with data across columns and each row has a column (col s) with a total.

    For the rows with a total of zero I'd like to hide that row.

    Any help would be appreciated.

    Twes

  2. #2
    MrExcel MVP Richie(UK)'s Avatar
    Join Date
    May 2002
    Location
    UK
    Posts
    3,330

    Default Re: How do I hide rows in a range with a zero total?

    Hi Twes,

    Welcome to the board :D

    How about Data / Filter / AutoFilter and then select the Custom option from the drop down filter list and 'does not equal' and '0'.

    HTH
    Richie

  3. #3
    New Member
    Join Date
    May 2003
    Posts
    2

    Default Re: How do I hide rows in a range with a zero total?

    Thank you.

    That is very helpful.

    Twes

  4. #4
    Board Regular
    Join Date
    Dec 2002
    Location
    London, ON, Canada
    Posts
    266

    Default Re: How do I hide rows in a range with a zero total?

    I have a macro that does it for me:
    Code:
    Sub HideZeroRows()
        Application.ScreenUpdating = False 'turn off screen updating
    
        Selection.EntireRow.Hidden = False
        Set wrkRange = Selection
        For Each rw In wrkRange.Rows
            If Application.Sum(rw) = 0 Then
                rw.EntireRow.Hidden = True
            End If
        Next
        Application.ScreenUpdating = True 'refresh the screen
    
    End Sub
    You just highlight the selection you want to hide the rows in and run the macro. I have it in my Personal.xls file and attached to a toolbar button so I can use it any time I need it.
    Have a Happy!
    Julica
    [Excel2007 SP2 on WinXP SP3]

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com