Run-Time Error '1004'


T

TJonesEsq

Dear Jon

Sub PrintPivotCharts()
'prints a chart for each item in the page field
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Set pt = ActiveChart.PivotLayout.PivotTable
For Each pf In pt.PageFields
For Each pi In pf.PivotItems
pt.PivotFields(pf.Name).CurrentPage = pi.Name
ActiveSheet.PrintPreview 'use this line for testing
' ActiveSheet.PrintOut 'use this line for printing
Next
Next pf
End Sub

Many thank
 
Ad

Advertisements


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.

Ask a Question

Top