Pivot table: Page breaks

  • Thread starter Thread starter John
  • Start date Start date
J

John

Is there anyway to prevent a pivot table row from being split onto two
pages when printed?
 
You could use the Workbook_BeforePrint event to set the print area. For
example:

'==================
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim str As String
str = Sheets("Sheet1").PivotTables(1).TableRange2.Address
With Sheets("Sheet1").PageSetup
.PrintArea = str
.CenterHorizontally = True
.CenterVertically = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

End Sub
'=========================
 
Back
Top