Page Breaks in VBA Q
Macro as per below, only prints out whats in the sheet "Header", whats in 'Month" and specified range is what I'm after
Sub Print_Per()
Dim i As Integer
Application.ScreenUpdating = False
With Sheets("Month")
With .PageSetup
.PrintArea = "$A$66:$HB$99"
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
End With
.ResetAllPageBreaks
.HPageBreaks.Add .Range("I100")
For i = 1 To 29
.VPageBreaks.Add .Cells(1, i * 7)
Next
End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("A1").Select
Application.Goto Sheets("Header").Range("A1")
End Sub
|