Loop through Pivot tables

Corgan

New Member
Joined
Mar 12, 2007
Messages
33
Hi

I was wondering if anyone knew of some code to loop through pivot tables? The issue I'm having is that I only want to loop through two specific pivots in a sheet not all pivots.

Thanks
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
What are you trying to achieve?

If you recorded a macro to look at selecting the first pivot and do something like update it, then the next it will give you the code you need to refer to both as they will have individual names.

<font face=Courier New><SPAN style="color:#00007F">Option</SPAN> <SPAN style="color:#00007F">Explicit</SPAN><br><br><SPAN style="color:#00007F">Sub</SPAN> mcrPivots()<br><SPAN style="color:#007F00">'</SPAN><br><SPAN style="color:#007F00">' Basic select and update 2 Pivots</SPAN><br><SPAN style="color:#007F00">'</SPAN><br><br><SPAN style="color:#007F00">'</SPAN><br>    Range("I4").Select<br>    ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh<br>    Range("P4").Select<br>    ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh<br>    Range("A1").Select<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,585
Messages
6,179,696
Members
452,938
Latest member
babeneker

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