Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating Multiple Charts from Same Pivot Table using macro

Hi
I have been writing a macro to process/reformat multiple data streams into a
single table for analysis. Analysis is driven by pivot table and associated
pivot chart. What I would like to do is to generate several chart views in
sequence, grabbing a copy or picture of each chart to form a standard report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Creating Multiple Charts from Same Pivot Table using macro

Hi,

You can copy the pivot chart as a picture in VBA. Here's an example:

Sub test()
'copy Chart1 as picture
Sheet1.ChartObjects("Chart 1").CopyPicture
'paste it in Sheet2 A1
Sheet2.Paste Range("A1")
End Sub


--
Hope that helps.

Vergel Adriano


"KenY" wrote:

Hi
I have been writing a macro to process/reformat multiple data streams into a
single table for analysis. Analysis is driven by pivot table and associated
pivot chart. What I would like to do is to generate several chart views in
sequence, grabbing a copy or picture of each chart to form a standard report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating Multiple Charts from Same Pivot Table using macro

Thanks for the sample code. Sorry I have not been able to try it today, but
it is on my sheet for Friday.
--
KenY


"Vergel Adriano" wrote:

Hi,

You can copy the pivot chart as a picture in VBA. Here's an example:

Sub test()
'copy Chart1 as picture
Sheet1.ChartObjects("Chart 1").CopyPicture
'paste it in Sheet2 A1
Sheet2.Paste Range("A1")
End Sub


--
Hope that helps.

Vergel Adriano


"KenY" wrote:

Hi
I have been writing a macro to process/reformat multiple data streams into a
single table for analysis. Analysis is driven by pivot table and associated
pivot chart. What I would like to do is to generate several chart views in
sequence, grabbing a copy or picture of each chart to form a standard report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating Multiple Charts from Same Pivot Table using macro

Vergel

I have tried this method, but have not been able to make it work. Could be
due to my lack of detailed knowledge of VBA as I tend to 'work from example'
even if that means recording similar code then working through the
adaptations.

I could not find the name of the chart (corresponding to your 'Chart1') so I
recorded a macro and tried replacing your statement with
ActiveChart.ChartArea.CopyPicture

This returned an error 438 - object does not support this property or method

I have solved my current problem a different way - create pivot chart then
delete the pivot table that is behind it.

Thanks
--
KenY


"Vergel Adriano" wrote:

Hi,

You can copy the pivot chart as a picture in VBA. Here's an example:

Sub test()
'copy Chart1 as picture
Sheet1.ChartObjects("Chart 1").CopyPicture
'paste it in Sheet2 A1
Sheet2.Paste Range("A1")
End Sub


--
Hope that helps.

Vergel Adriano


"KenY" wrote:

Hi
I have been writing a macro to process/reformat multiple data streams into a
single table for analysis. Analysis is driven by pivot table and associated
pivot chart. What I would like to do is to generate several chart views in
sequence, grabbing a copy or picture of each chart to form a standard report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Creating Multiple Charts from Same Pivot Table using macro

You could copy the pivot table, make the chart, and delete the copy of the
pivot table.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______

"KenY" wrote in message
...
Hi
I have been writing a macro to process/reformat multiple data streams into
a
single table for analysis. Analysis is driven by pivot table and
associated
pivot chart. What I would like to do is to generate several chart views
in
sequence, grabbing a copy or picture of each chart to form a standard
report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be
telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating Multiple Charts from Same Pivot Table using macro

Thanks - in the process of writing out my problem I thought of that approach
and have implemented that solution although it may not be the most efficient
approach - it works. I am also going to try the suggestion from Vergel
Adriano.

--
KenY


"Jon Peltier" wrote:

You could copy the pivot table, make the chart, and delete the copy of the
pivot table.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______

"KenY" wrote in message
...
Hi
I have been writing a macro to process/reformat multiple data streams into
a
single table for analysis. Analysis is driven by pivot table and
associated
pivot chart. What I would like to do is to generate several chart views
in
sequence, grabbing a copy or picture of each chart to form a standard
report.

Problem - Excel does not allow copy/pastespecial/picture type actions on a
PivotChart.

Possible solutions with issues
1 It does not seem efficient to create the pivot table, pivot chart and
then delete the associated pivot table (as I understand 'Help' to be
telling
me I should) just to get the picture.
2 Creating multiple instances of the pivot table with different field
selections and a pivot chart associated with instance does not seem to
efficient either.

Can anyone suggest a better way?

Thanks
--
KenY




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
multiple charts from a single pivot table Yossi evenzur[_2_] Charts and Charting in Excel 2 February 23rd 10 07:47 PM
problem creating a pivot table using a macro [email protected] Excel Programming 2 March 27th 07 11:40 AM
How do I create multiple pivot charts from one pivot table? Rudy Charts and Charting in Excel 1 March 17th 06 10:01 PM
creating pivot charts from multiple pages lewscannon Excel Programming 0 May 23rd 05 06:11 PM
Help with a macro creating a formula for a pivot table Valeria Excel Programming 1 November 20th 04 12:40 AM


All times are GMT +1. The time now is 04:31 PM.

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"