Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot table refresh code failed
i'm trying to write some code so that a change in the source tabl triggers a refresh process for all my pivot tables (on other sheets). so far, i've tried something like this: Private Sub Worksheet_Change(ByVal Target As Range) Dim PT As PivotTable Application.EnableEvents = False For Each PT In Me.PivotTables PT.RefreshTable Next PT Application.EnableEvents = True End Sub it doesn't automatically update, but all the pivot tables get refreshe once i refresh one of them. i've also tried: Private Sub Worksheet_Calculate() blah.PivotTables("PivotTable1").PivotCache.Refresh but i get an error: Run-time error '1004': Method 'PivotTables' of object'_Worksheet' failed any ideas? thanks -- dream ----------------------------------------------------------------------- dreamz's Profile: http://www.excelforum.com/member.php...fo&userid=2646 View this thread: http://www.excelforum.com/showthread.php?threadid=47890 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA code to refresh Child Pivot Table | Excel Discussion (Misc queries) | |||
Sheet protection code conflicts with Pivot Table "auto refresh" | Excel Discussion (Misc queries) | |||
Code to Refresh Pivot Table | Excel Programming | |||
How To Finish pivot table refresh before cont. VBA code | Excel Programming | |||
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH | Excel Programming |