Hello...
I'm using the vba code below to set up print area and avoid printing blank pages, but it doesn't seem to work.
Can someone please help?
Column A to S is fixed but the row can sometimes short or long. When it's short, all the blank pages got printed too.
Dim rng As Range
Dim k As Range
On Error Resume Next
k = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = ActiveSheet.Range("A1:S" & k)
With ActiveSheet.PageSetup
.PrintArea = rng.Address
.Orientation = xlLandscape
End With
Application.ScreenUpdating = True
I'm using the vba code below to set up print area and avoid printing blank pages, but it doesn't seem to work.
Can someone please help?
Column A to S is fixed but the row can sometimes short or long. When it's short, all the blank pages got printed too.
Dim rng As Range
Dim k As Range
On Error Resume Next
k = Cells(Rows.Count, 1).End(xlUp).Row
Set rng = ActiveSheet.Range("A1:S" & k)
With ActiveSheet.PageSetup
.PrintArea = rng.Address
.Orientation = xlLandscape
End With
Application.ScreenUpdating = True