Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for pivot table and printing.....
I tried to set up a macro procedure for printing a pivot table. My
situation is this, I already set up a pivot table with different location numbers and other pertinent info. I want to print a single page for each location. As you know , if I do it manually, I have to select each location from the list one at a time and print each one. I just want to know if a macro procedure can be done on this operation. So that I do not have to select any location and Macro will do the work for me. Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for pivot table and printing.....
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 '============================ JC wrote: I tried to set up a macro procedure for printing a pivot table. My situation is this, I already set up a pivot table with different location numbers and other pertinent info. I want to print a single page for each location. As you know , if I do it manually, I have to select each location from the list one at a time and print each one. I just want to know if a macro procedure can be done on this operation. So that I do not have to select any location and Macro will do the work for me. Thanks. -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Printing Pivot Table Pie Charts | Charts and Charting in Excel | |||
Pivot table - printing specific data | Excel Discussion (Misc queries) | |||
Pivot table printing | Excel Programming | |||
Printing a pivot table | Excel Programming | |||
Pivot Table: Complex printing issue???? | Excel Programming |