Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to refresh Child Pivot Table HKS Excel Discussion (Misc queries) 0 May 7th 08 07:49 PM
Sheet protection code conflicts with Pivot Table "auto refresh" KG Excel Discussion (Misc queries) 6 December 21st 05 11:16 PM
Code to Refresh Pivot Table S Jackson Excel Programming 1 August 31st 05 05:40 PM
How To Finish pivot table refresh before cont. VBA code graham Excel Programming 0 June 24th 04 06:22 AM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


All times are GMT +1. The time now is 09:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"