Good afternoon, I found this VBA code on one of your post for printing a copy of a pivot table for each item field.
I tried to modify it without success to set up a dynamic print area to fit on 1 page landscape, since each item field have a different size (some 6 rows, some have 100 rows or more). Any suggestions??
Private Sub CommandButton1_Click()
'prints a copy of pivot table for each item in page field
'assumes one page field exists
On Error Resume Next
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Set pt = ActiveSheet.PivotTables.Item(1)
For Each pf In pt.PageFields
For Each pi In pf.PivotItems
pt.PivotFields(pf.Name).CurrentPage = pi.Name