View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Hiding rows on a sheet before printing

try this. You can assign or better to put in the Before_print of the
ThisWorkbook module.

Sub hiderowsifformulawithblank()
Rows.Hidden = False
lr = Cells(Rows.Count, "a").End(xlUp).Row
For i = 2 To lr
If Cells(i, 1).HasFormula And _
IsNumeric(Cells(i, 1)) = False Then _
Rows(i).Hidden = True
Next i
End Sub

--
Don Guillett
SalesAid Software

"pano" wrote in message
oups.com...
Hi all,
How would I go about hiding rows as a result of a blank in column
A(there is a formula in columnA which gives a blank) and a 0 in column
B, there is blank cells between 4/3/07 and 5/3/07. I would most likely
only do this at the time of printing as the user does not see this
sheet it is all auto filled from data on other sheets. The sheet is
called Carlog.

A B C D
1/3/07 0 0
2/3/07 0700 1526 8.26
3/3/07 0700 1526 8.26
4/3/07 0700 1526 8.26



5/3/07 0700 1526 8.26
6/3/07 0700 1526 8.26


thanks
Stephen