Pivot Tables and macro

frajaro

New Member
Joined
Mar 13, 2002
Messages
13
Dear MrExcel,

I have been working with Pivot tables for a long period and getting more and more triks from experience and your useful web. Now, I'm trying to improve a file for data analysis by using macros connected with Pivot tables. My question is:

¿Is there any way to execute a macro each time I select an option of the Pivot Table?

I'd appreciate very much your answer,
thank in advance

Francisco
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Use a Worksheet_Change event procedure for the worksheet containing the pivot table.Open Project Explorer (Ctrl+R), locate the workbook, expand for worksheet objects and double click on the appropriate worksheet icon. When the code window opens, select the Change event and insert the code to be run.
 
Upvote 0
Thanks a lot for the advice.
I would like to have your comments to the following case related to the same issue:

When I use the calculate event procedure for the worksheet containing my Pivot Table it works well. Howewer, when I try to modify or change any cell in other worksheet or workbook the macro is also executed. I noticed this happens only when there is a function INDIRECT included in the worksheet containing the pivot table.

Is seems that INDIRECT function forces the activation of the change/calculate event procedure after any change in any sheet or workbook. (although the procedure is just associated to worksheet1)

¿do you know how to solve this unwished activation of the event?

regards
Francisco (frajaro)
 
Upvote 0

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

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