ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Refreshing pivot table from different worksheet (https://www.excelbanter.com/excel-programming/348581-refreshing-pivot-table-different-worksheet.html)

mandles1[_2_]

Refreshing pivot table from different worksheet
 

Hi,
I'm hoping someone can help me out with refreshing a pivot table from a
different worksheet than the one it is in.
I have the following code as part of my macro:

Application.Worksheets("PivotTable-contracts").Activate
ActiveSheet.PivotTables("PivotTable3").PivotCache. Refresh


I also have 2 other worksheets, "PivotTable-products" and
"PivotTable-prices" which I would like to refresh when the same macro
is run. These however are not part of the active worksheet, so how do I
have these two pivot tables refresh by calling them from a different
worksheet?
I've tried a couple things, like:


Worksheets("PivotTable-products").PivotTables("PivotTable4").PivotCache.R efresh

which doesn't seem to work.

Any suggestions would be greatly appreciate!
Thanks- Mandy.


--
mandles1
------------------------------------------------------------------------
mandles1's Profile: http://www.excelforum.com/member.php...o&userid=29754
View this thread: http://www.excelforum.com/showthread...hreadid=495053



All times are GMT +1. The time now is 03:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com