469,621 Members | 1,685 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,621 developers. It's quick & easy.

Selectively refresh pivot table

3
I have two pivot tables, but when my macro refreshes the pivot tables it refreshes all, but I want it to pick say for example;

Say range "B8" of pivot table 1 is 60, I want the range "x2" of pivot table 7 also to pick 60 and then refersh it. Below is the coding which I have done, can anyone help?

Expand|Select|Wrap|Line Numbers
  1. Range("B8").Select
  2.     ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
  3.     Range("B31").Select
  4.     ActiveSheet.PivotTables("PivotTable2").PivotCache.Refresh
  5.     Range("B54").Select
  6.     ActiveSheet.PivotTables("PivotTable3").PivotCache.Refresh
  7.     Range("B77").Select
  8.     ActiveSheet.PivotTables("PivotTable4").PivotCache.Refresh
  9.     Range("B100").Select
  10.     ActiveSheet.PivotTables("PivotTable5").PivotCache.Refresh
  11.     Range("B129").Select
  12.     ActiveSheet.PivotTables("PivotTable6").PivotCache.Refresh
  13.     Range("X2").Select
  14.     ActiveSheet.PivotTables("PivotTable7").PivotCache.Refresh
  15.     Range("X24").Select
  16.     ActiveSheet.PivotTables("PivotTable8").PivotCache.Refresh
  17.     Range("X49").Select
  18.     ActiveSheet.PivotTables("PivotTable9").PivotCache.Refresh
  19.     Range("X76").Select
  20.     ActiveSheet.PivotTables("PivotTable10").PivotCache.Refresh
  21.     Range("X101").Select
  22.     ActiveSheet.PivotTables("PivotTable11").PivotCache.Refresh
  23.     Range("AM5").Select
  24.     ActiveSheet.PivotTables("PivotTable12").PivotCache.Refresh
  25.     Range("AM29").Select
  26.     ActiveSheet.PivotTables("PivotTable13").PivotCache.Refresh
  27.     Range("AM59").Select
  28.     ActiveSheet.PivotTables("PivotTable14").PivotCache.Refresh
  29.     Range("AM89").Select
  30.     ActiveSheet.PivotTables("PivotTable15").PivotCache.Refresh
  31.     Range("AM115").Select
  32.     ActiveSheet.PivotTables("PivotTable16").PivotCache.Refresh
  33.     MsgBox ("Please proceed to updating the layout rotation")
  34.  
  35. End Sub
Thanks a Mill!
Jul 30 '07 #1
0 1524

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Prasad Patil | last post: by
2 posts views Thread by Rob | last post: by
3 posts views Thread by Jerry K via DotNetMonster.com | last post: by
8 posts views Thread by PhilBowen | last post: by
bhcob1
4 posts views Thread by bhcob1 | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.