View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default How can i auto hide empty rows in printing in excel?

Private Sub Workbook_BeforePrint(Cancel As Boolean)
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = LastRow To 1 Step -1
If Application.CountA(Rows(r)) = 0 Then
Rows(r).EntireRow.Hidden = True
End If
Next r
End Sub


Gord Dibben MS Excel MVP

On Fri, 1 Aug 2008 02:25:00 -0700, TM wrote:

How can I auto hide empty rows in printing a table in excel?