Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello
I have 50 pivot tables( 1 original and 49 copies) that need to be refreshed when I open the workbook. Is there a way to write a For Each...Next procedure to step through all the pivot tables on a given sheet? Thanks! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tony,
You can set a flag to make each pivottable (cache) update on open. Here is some code to set the flag For Each pc In ActiveWorkbook.PivotCaches pc.RefreshOnFileOpen = True Next or if you want to do it each time the sheet opens via code Sub Macro1() Dim ptblcache As PivotCache For Each ptblcache In ThisWorkbook.PivotCaches ptblcache.Refresh Next ptblcache Set ptblcache = Nothing End Sub Best of luck, Stewart Rogers "Tony White" wrote: Hello I have 50 pivot tables( 1 original and 49 copies) that need to be refreshed when I open the workbook. Is there a way to write a For Each...Next procedure to step through all the pivot tables on a given sheet? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refreshing Pivot Tables | Excel Discussion (Misc queries) | |||
When refreshing pivot tables my pivot table chart type changes | Excel Discussion (Misc queries) | |||
Refreshing Pivot Tables | Excel Worksheet Functions | |||
pivot tables not refreshing correctly | Excel Worksheet Functions | |||
Pivot Tables are Automatically refreshing | Excel Discussion (Misc queries) |