B
Bob
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
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