Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I am trying to use this code to hide all empty rows in column A when printing
I would like to start in row 6 an end in row 2000 so my header will print. It doesn't work can you tell why? Sub Hide_Print_Unhide() Dim rw As Long Application.ScreenUpdating = False With Sheets("Production") For rw = 1 To 2000 If Application.WorksheetFunction.CountA( _ .Cells(rw, 1).Range("A1:A2000")) = 0 Then _ .Rows(rw).Hidden = True Next rw .PrintPreview ' for testing use .PrintPreview .Range("A1:A2000").EntireRow.Hidden = False End With Application.ScreenUpdating = True End Sub Thank you for your help, Bob |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Tables & not printing blank rows (revisited) | Excel Discussion (Misc queries) | |||
Format to hide empty rows | Excel Discussion (Misc queries) | |||
Can Excel "slide up" rows with content thru empty rows to condense | Excel Worksheet Functions | |||
how to hide rows in a protected sheet | Excel Worksheet Functions | |||
Macro to hide rows with empty cells | Excel Worksheet Functions |