Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old October 11th, 2004, 09:47 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using Customized chart for Pivot Chart

I wanted to use one of my customized charts (2 stack bars and one trending line to show 3 piece of data) as pivot chart. However, every time I click on the break to change a data value, Excel defaults the chart back to the 3-stacked-bar chart which is one of standard chart that I used to create my customized chart.

Is there a way for me to use my customized chart as pivot chart? I have tried many methods, including recording macro to see how default is set up and how pivot chart is created. But just no success in reaching what I am trying to do. If I need to write macro to achieve this, does anyone have a sample for me to model from?

Thanks

Kathy

Reply With Quote
  #2 (permalink)  
Old October 12th, 2004, 12:36 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: , , Finland.
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Kathy

You must record a macro which does the cutomizing to your chart. Copy the macro to the Chartsheet calculate event. Every time you change your Pivot chart the Chart calculate event runs the code.

Here is some example:

Private Sub Chart_Calculate()
    ActiveChart.SeriesCollection(2).Select
    ActiveChart.SeriesCollection(2).ChartType = xlLine
End Sub

-vemaju


Reply With Quote
  #3 (permalink)  
Old October 12th, 2004, 04:39 PM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi vemaju-

Thanks for responding to my question. But how to automate so that when I click on the page break for different values on the chart sheet, which is created by using pivot chart, it will execute the Chart_Calculate to display the desired chart? I was thinking about designing a form to accomplish such task, but was glad to see your suggestion which seems to be easier. I have already created a macro for my customized chart. But just don't know how to link the pieces together.

Thank you in advance for your help.

Kathy


Reply With Quote
  #4 (permalink)  
Old October 13th, 2004, 09:37 AM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vemaju -

I investigated further, provided your previous input. And it worked. Thank you so much again.

Kathy

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting Excel pivot chart into Word document jfejsa Excel VBA 3 March 15th, 2007 03:53 PM
OWC10: binding Chart to Pivot Table rfrancisco Classic ASP Components 0 February 10th, 2006 12:47 PM
Inserting Excel pivot chart into Word documents jfejsa Word VBA 1 January 23rd, 2006 08:16 PM
Pivot Chart View Problems wall_of_jericho Access 1 July 27th, 2005 11:05 AM
Drill Down from Bar Chart to another chart snowbird Crystal Reports 0 July 11th, 2003 01:53 PM



All times are GMT -4. The time now is 01:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.