Pivot graph

  • Thread starter Thread starter Ludavhen
  • Start date Start date
L

Ludavhen

Hello,
I have a graph from a pivot. This graph allows me to see the trends of the
selected department. In the graph itself I can select the department fom
the pull-down.

My problem is that I have to print all these trend-graphs, and the only way
I know of is by selecting the department and printing the graph. Then
selecting the next department, print, an so on. Is there a way to print all
the departments in one go? I thought I could do this by selecting "show
pages" but his option is not available in the graph only in the pivot sheet
itself. There I can select "show pages" but I only get the pivots of the
departments in different sheet but not the graph.

Thanks for your help.
 
The following code will print the pivot table for each item in the page
field:

'=======================
Sub PrintPivotPages()
'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
' ActiveSheet.PrintOut 'use this for printing
ActiveSheet.PrintPreview 'use this for testing
Next
Next pf
End Sub

'============================
 
Debra,
Thanks for the invested time. Really appreciated. I'll try this as soon as
I get back to my office (it is 22:30 now local time).
Just a question..How do I get this code into the sheet? Must I save it as a
macro or..???
 
Back
Top