View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Daniel.C[_3_] Daniel.C[_3_] is offline
external usenet poster
 
Posts: 133
Default Can I suppress printing a line if a value = 0?

Try the following macro (the zero values being in column A) :

Sub printWithoutZeroes()
Dim c As Range
For Each c In Range([A1], [A65000].End(xlUp))
If c = 0 Then c.EntireRow.Hidden = True
Next c
ActiveSheet.PrintPreview
Range([A1], [A65000].End(xlUp)).EntireRow.Hidden = False
End Sub

HTH
Daniel

I am printing a chart of accounts but would like to suppress the lines for
which there a no values, so that the report won't have all these zero
balances showing