Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing Pivot Table Pie Charts sherobot Charts and Charting in Excel 0 May 25th 06 01:24 AM
Pivot table - printing specific data Doug Excel Discussion (Misc queries) 1 April 24th 05 08:29 PM
Pivot table printing wong Excel Programming 0 July 20th 04 03:36 AM
Printing a pivot table Grant[_5_] Excel Programming 4 May 19th 04 05:56 AM
Pivot Table: Complex printing issue???? Joe Mathis Excel Programming 1 November 21st 03 05:03 PM


All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"