Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using this code to hide all of my empty rows when printing. How can I
start at row 6 so that my header does not get hidden? Private Sub Workbook_BeforePrint(Cancel As Boolean) If ActiveSheet.Name = "Production" Then Cancel = True Application.EnableEvents = False Application.ScreenUpdating = False With ActiveSheet On Error Resume Next .Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = True .PrintOut .Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = False On Error GoTo 0 End With Application.EnableEvents = True Application.ScreenUpdating = True End If End Sub Thank you for you help, Bob |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Instead of Columns("A"), use:
Columns("A").Resize(Rows.Count - 5).Offset(5) -- Vasant "Bob" wrote in message ... I am using this code to hide all of my empty rows when printing. How can I start at row 6 so that my header does not get hidden? Private Sub Workbook_BeforePrint(Cancel As Boolean) If ActiveSheet.Name = "Production" Then Cancel = True Application.EnableEvents = False Application.ScreenUpdating = False With ActiveSheet On Error Resume Next .Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = True .PrintOut .Columns("A").SpecialCells(xlCellTypeBlanks).Entir eRow.Hidden = False On Error GoTo 0 End With Application.EnableEvents = True Application.ScreenUpdating = True End If End Sub Thank you for you help, Bob |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help on Macro to hide empty rows | Excel Discussion (Misc queries) | |||
hide empty rows on open | Excel Discussion (Misc queries) | |||
How can i auto hide empty rows in printing in excel? | Excel Discussion (Misc queries) | |||
Is there a way to automatically hide empty rows? | Excel Worksheet Functions | |||
Hide Empty Rows When Printing | Excel Worksheet Functions |