Run macro when Pivot Table changes

frajaro

New Member
Joined
Mar 13, 2002
Messages
13
To run a macro every time I select an option of a pivot table I used the event handler WS_change. Unfortunately this doesn't work for Pivot Tables so I used the WS_calculate but this option slow down the process and is producing other little problems in my worksheet.

Is there any better method to run a macro after any Pivot table change?.

thanks in advance for your reply
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I have been confronted with a similar problem. I don't know of another event, but it might help to know that after changing a field (selection) in a PT, the "active cell" is always inside the table. So at the beginning of the WS_Calculate event handler, you could check whether the active cell is within the PT and exit the handler immediately if this is not the case.

Marc
 
Upvote 0
On 2002-04-23 06:46, paelinck wrote:
I have been confronted with a similar problem. I don't know of another event, but it might help to know that after changing a field (selection) in a PT, the "active cell" is always inside the table. So at the beginning of the WS_Calculate event handler, you could check whether the active cell is within the PT and exit the handler immediately if this is not the case.

Marc

Hello Mark, thanks for the tip,
Actually, the Worksheet_Calculate event works fine except when cells with Indirect funtion are present in my Worksheet. In that case, any change in any other open worksheet or workbook (with no relation to the one containing the PT)run the macro of the handler, which is really strange. Any idea about the reason?


regards
Francisco
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,255
Members
448,556
Latest member
peterhess2002

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