View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pano pano is offline
external usenet poster
 
Posts: 84
Default Hiding rows on a sheet before printing

On Feb 11, 3:13 pm, "pano" wrote:
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


Ok have found this in the archives and modified it to suit can anyone
see anything worng with this, I dont need it to fall over when needed.
I guess I put the printing part after the hiding row part????? and
pres the button and away we go.??

Sub HideRows()
Dim i As Long
Application.ScreenUpdating = False
For i = 10 To 44
For j = 10 To 44
If Range("A" & i).Value = "" Then
Range("A" & i).EntireRow.Hidden = True
End If
If Range("b" & j).Value = 0 Then
Range("b" & j).EntireRow.Hidden = True
End If
Next 'i
Next 'j
Application.ScreenUpdating = True
End Sub