Supressing Rows with zero values


Posted by Steve on April 20, 2001 10:31 AM

I have multiple workbooks in which a product may have had activity last year but none so far this year. When I print the report without hiding the zero rows 14 pages spew from the printer. If I manually suppress the zero rows the report is only 8 or 9 pages in length. I'm leaning towards a loop function that scrolls down the column and each time it encounters a zero value (resulting from a formula) suppress (hide) the row. The loop will continue until it encounters the word STOP in some row below the last line of potential data. I can envision the process but the mechanics have me somewhat baffled.



Posted by Dave Hawley on April 20, 2001 10:54 AM


Hi Steve

rather than use a Loop (which are horrible sloow) use Excels Autofilter like this:

Sub TryThis()

With Sheet1
.AutoFilterMode = False
.Cells(1, 1).AutoFilter
.Cells(1, 1).AutoFilter Field:=1, Criteria1:="<>0"
End With

End Sub


Dave

OzGrid Business Applications