+ Reply to Thread
Results 1 to 8 of 8

Suppress zero value rows?

Hybrid View

Casino Suppress zero value rows? 05-29-2007, 03:25 PM
VBA Noob Format cell as 0;; or ... 05-29-2007, 03:37 PM
Casino Thanks for the reply (love... 05-29-2007, 03:47 PM
VBA Noob Does this link help ... 05-29-2007, 04:05 PM
Casino Automate the code? 05-29-2007, 04:22 PM
  1. #1
    Registered User
    Join Date
    05-29-2007
    Posts
    6

    Suppress zero value rows?

    Hi, I have a large linked spreadsheet that auto-fills each month. Each month, different rows have a zero total. How can I format the sheet so all of the zero total rows hide? Right now these sheets are multi-page. If I can suppress the rows with a zero total, it will print cleaner on 1 page, but it has to adapt each month to hide different rows.

    Thanks!

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Format cell as 0;;

    or

    take a look at link under zero values

    http://www.bettersolutions.com/excel...T710262222.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    05-29-2007
    Posts
    6
    Thanks for the reply (love your icon). Your solution hides the zero value, but it does not suppress, or hide the entire row. I need for the row to disappear completely when the total is zero. Any ideas?

    Thanks again!

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

  5. #5
    Registered User
    Join Date
    05-29-2007
    Posts
    6

    Automate the code?

    You are my hero!!! That worked! Now for the next question. I'm not a macro user, so hopefully this doesn't sound to stupid. Now that I have the code in the module (and I know it works when I click run), how do I automate this so I don't have to manually go into every sheet to run this?

    Thanks!

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Not an expert on VBA but this seems to work

    Sub Hide_rows()
    Dim LastRow As Long
    Dim Rng As Range
    Dim Sht As Worksheet
    Dim allwShts As Sheets
    Set allwShts = Worksheets
    Dim Asht As Worksheet
    Set Asht = ActiveSheet
    Application.ScreenUpdating = False
    For Each Sht In allwShts
    For i = 1 To allwShts.Count
    Sheets(i).Select
    LastRow = Sheets(i).Range("A65536").End(xlUp).Row ' << Change Col A to your Col
    Set Rng = Sheets(i).Range("A1:A" & LastRow) ' << Change Col A to your col
    For Each cell In Rng
    If cell.Value = "0" Then
    cell.EntireRow.Hidden = True
    End If
    Next cell
    Next i
    Next Sht
    Asht.Select
    Application.ScreenUpdating = True
    End Sub
    VBA Noob

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1