Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Newbie
 
Posts: n/a
Default Printing a Pivot Table from code - Excel 2003

Hi,

I have a pivot table that constantly changes based on what the user chooses
to analyse.

I want the user to be able to print the pivot table at the click of a button
with having to keep setting the print area.

Is there a way to do this programmatically

If yes, how?

Thanks


  #2   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You shouldn't have to set a print area. If the pivot table is the only
thing on the worksheet, only the pivot table range will print.

Newbie wrote:
Hi,

I have a pivot table that constantly changes based on what the user chooses
to analyse.

I want the user to be able to print the pivot table at the click of a button
with having to keep setting the print area.

Is there a way to do this programmatically

If yes, how?

Thanks




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Newbie
 
Posts: n/a
Default

Thanks but there are other things on the worksheet . . . . any other ideas?
"Debra Dalgleish" wrote in message
...
You shouldn't have to set a print area. If the pivot table is the only
thing on the worksheet, only the pivot table range will print.

Newbie wrote:
Hi,

I have a pivot table that constantly changes based on what the user
chooses to analyse.

I want the user to be able to print the pivot table at the click of a
button with having to keep setting the print area.

Is there a way to do this programmatically

If yes, how?

Thanks



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



  #4   Report Post  
Debra Dalgleish
 
Posts: n/a
Default

You could use the TableRange2 property to create an address for the
print area. For example:

'==============================
Dim ws As Worksheet
Dim rngPT As Range
Dim strPT As String

Set ws = ActiveSheet
Set rngPT = ws.PivotTables(1).TableRange2
strPT = rngPT.Address

ws.PageSetup.PrintArea = strPT
'=====================

Newbie wrote:
Thanks but there are other things on the worksheet . . . . any other ideas?
"Debra Dalgleish" wrote in message
...

You shouldn't have to set a print area. If the pivot table is the only
thing on the worksheet, only the pivot table range will print.

Newbie wrote:

Hi,

I have a pivot table that constantly changes based on what the user
chooses to analyse.

I want the user to be able to print the pivot table at the click of a
button with having to keep setting the print area.

Is there a way to do this programmatically

If yes, how?

Thanks



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #5   Report Post  
Newbie
 
Posts: n/a
Default

Thanks I'll give it a go
"Debra Dalgleish" wrote in message
...
You could use the TableRange2 property to create an address for the
print area. For example:

'==============================
Dim ws As Worksheet
Dim rngPT As Range
Dim strPT As String

Set ws = ActiveSheet
Set rngPT = ws.PivotTables(1).TableRange2
strPT = rngPT.Address

ws.PageSetup.PrintArea = strPT
'=====================

Newbie wrote:
Thanks but there are other things on the worksheet . . . . any other

ideas?
"Debra Dalgleish" wrote in message
...

You shouldn't have to set a print area. If the pivot table is the only
thing on the worksheet, only the pivot table range will print.

Newbie wrote:

Hi,

I have a pivot table that constantly changes based on what the user
chooses to analyse.

I want the user to be able to print the pivot table at the click of a
button with having to keep setting the print area.

Is there a way to do this programmatically

If yes, how?

Thanks


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html






--
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
can a workbook with macros created in excel 2003 work in excel 20. Steve Venti Excel Discussion (Misc queries) 2 December 27th 04 02:31 PM
Excel 2000 file when opened in Excel 2003 generates errors? Doug Excel Discussion (Misc queries) 13 December 25th 04 10:20 PM
pivot table multi line chart souris Charts and Charting in Excel 2 December 7th 04 03:56 AM
convert excel list to pivot table GI Excel Discussion (Misc queries) 0 December 6th 04 06:45 PM
In excel and a pivot table - how can I stop it displaying (blank). Mansel Excel Discussion (Misc queries) 1 December 2nd 04 12:55 AM


All times are GMT +1. The time now is 02:25 AM.

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

About Us

"It's about Microsoft Excel"