adamsm
03-19-2011, 09:17 AM
The following code is designed to print only the visible rows. But the code sets print area to individual visible rows.
Sub PrintDialogByChangingNumber()
Application.ScreenUpdating = False
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintArea = Range("D3:P" & LR).SpecialCells(xlCellTypeVisible).Address
End With
Application.Dialogs(xlDialogPrint).Show
Range("P4").Value = Range("P4").Value + 1
Application.ScreenUpdating = True
End Sub
How could the code be changed so that it selects the visible rows as a whole?
Any help on this would be kindly appreciated.
Thanks in advance.
Sub PrintDialogByChangingNumber()
Application.ScreenUpdating = False
Dim LR As Long
LR = Range("D" & Rows.Count).End(xlUp).Row
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintArea = Range("D3:P" & LR).SpecialCells(xlCellTypeVisible).Address
End With
Application.Dialogs(xlDialogPrint).Show
Range("P4").Value = Range("P4").Value + 1
Application.ScreenUpdating = True
End Sub
How could the code be changed so that it selects the visible rows as a whole?
Any help on this would be kindly appreciated.
Thanks in advance.