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
'=========================
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.