LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default PivotTables Refresh not work

Hi,
The following is the VBA code which is used to refresh
the PivotTable. But I found that it is always failed to
reflect newly added data (without any error) after the
first refresh.
Have anyone have any idea?
================================================== =========
Sub report_refresh()
Dim datarange As Variant

Sheets("report").Select
On Error Resume Next
ActiveSheet.PivotTables("Report1").PivotSelect "",
xlDataAndLabel
datarange = "Data!R1C1:R" & Trim(Str(Worksheets
("Container").Range("max_data").Value)) & "C6"
Sheets("Report").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase,
SourceData:= _
datarange
ActiveSheet.PivotTables("Report1").RefreshTable

Application.CommandBars("PivotTable").Visible = False

End Sub

 
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
F9 Calc refresh does not work... LinLin Excel Discussion (Misc queries) 3 February 23rd 10 12:10 PM
How to refresh dropdown lists in PivotTables? Eleanor M Excel Discussion (Misc queries) 6 March 3rd 06 02:11 PM
"Refresh All" won't work with external Access data located on serv Victoria @ WB Links and Linking in Excel 3 April 1st 05 08:03 AM
Form.Refresh doesn't work...help !! Tereba[_2_] Excel Programming 2 January 31st 04 10:43 PM
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 01:57 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"