Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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

  #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


  #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


  #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



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 01:47 PM
Inserting Excel pivot chart into Word documents jfejsa Word VBA 1 January 23rd, 2006 09: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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.