Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Code to Refresh Pivot Table

I have a workbook with multiple worksheets. Each worksheet has its own
pivot table.

I put this code on the first worksheet with a pivot table and it works
great:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub
But, when I copy this code to the second worksheet, I get this error:
"Pivot table is not valid."

What's up?
S. Jackson


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Code to Refresh Pivot Table

Okay, I somehow fixed my problem by simply deleting the pivot table on the
second worksheet and then re-inserting it. Everything works fine now. Go
figure?

S. Jackson

"S Jackson" wrote in message
...
I have a workbook with multiple worksheets. Each worksheet has its own
pivot table.

I put this code on the first worksheet with a pivot table and it works
great:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub
But, when I copy this code to the second worksheet, I get this error:
"Pivot table is not valid."

What's up?
S. Jackson




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
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 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 06:59 AM.

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

About Us

"It's about Microsoft Excel"