Printing Pivot Table Pages

  • Thread starter Thread starter Paul Mendelowitz
  • Start date Start date
P

Paul Mendelowitz

I have a pivot table with 25 individual data items in the
page field. I want to print a copy of the pivot table
individually for each of the 25 pages. Is there a way to
automatically do this without having to go to each page
and print it individually and manually?

Thanks for your help.

Paul
 
The following code will print the a copy of the pivot table for each
item in the page field:

Sub PrintPivotPages()
'prints a copy of each customer record from pivot table
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
' ActiveSheet.PrintOut 'use this for printing
ActiveSheet.PrintPreview 'use this for testing
Next
Next pf
End Sub
 
Back
Top