marco after selection in PV table

  • Thread starter Thread starter Dennis Cheung
  • Start date Start date
D

Dennis Cheung

can i build a marco to run automatically after making a selection of field
in pivot table?

dennis
 
Dennis,

Quite simply ... use

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Run ("TheNameofYourMacro")
Application.EnableEvents = True
End Sub

HTH
Carim
 
Dear Carim,

i save the code in sheet1, my table is in sheet1. but the marco didn't run.
can u help again?

Dennis
 
Carim,

i am sorry that it didn't work as i follow your instruction. do i miss
anything or did something wrong?

Dennis

dennis
 
Because the pivot table is an object, its refresh does not trigger a
worksheet calculate event, therefore you need a volatile function such
as now() or any function linked to the result of your pivot table being
recalculated such as
=MATCH("Grand Total",A:A,1) to fire the event...

HTH

Carim
 
Dear Carim,

I tried your formula but the Marco did'nt run. Can you explain more
specific? I am not familar to VBA. Thanks again!

Dennis
 
Dennis,

Make sure your Excel is set with automatic calculation ...
Tools Option Calculation Automatic

Otherwise, I am sorry I cannot help you out anymore ...

HTH

Carim
 
it works now. thanks. but i didn't change any of the setting in my excel. ??

Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top