Muliple Charts from one Pivot Table

T

TJonesEsq

Debra,

many thanks for that but I was looking for a more automated way. Ther
are over 600 stores. Is there a vb code way in doing this?

Best regards

Ton
 
D

Debra Dalgleish

If you want to print a copy of the chart for each store, you could use
code similar to the following:

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
 

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