Pivot chart change event macro

gooniegirl180

Board Regular
Joined
Aug 13, 2003
Messages
152
Hi all, sorry for the basic nature of this one but I'm just not up to scratch on macros yet! I have a pivot chart which, of course, doesn't hold it's formatting. I have recorded a macro which puts the chart back the way I want it, except that I want the macro to execute automatically when any of the pivot fields are changed (eg when the user selects a specific page field).

How do I do this? I've seen something like "Private Sub Chart_Change" but it has this "(ByVal)" bit which I don't understand after it, and I don't know if I need this or how to apply it to my chart.

Thanks in advance!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Use this event handler:
Code:
Private Sub Worksheet_Calculate()
    Enter your macro here
End Sub
 
Upvote 0
I've managed to get the solution, and here it is:

First, I right mouse clicked on the sheet tab where the pivotchart was, then selected view code.

Then, in the Object Box, I selected "Chart". Next, in the Declarations box, I selected "Calculate".

Finally, I copied my previously recorded macro into that and it works a treat!! Everytime a user changes the page fields in the pivot table, the formatting updates automatically!

Thanks for your help,
Jane
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,543
Members
452,924
Latest member
JackiG

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top