Senin, 23 Mei 2011

[ExcelVBA] Refreshing Pivot Tables

 

I have an Excel 2007 worksheet that has Source Data and a PivotTable on the same worksheet. I have VBA code that works well to refresh a pivot table that is on a separate worksheet, but doesn't work if the pivot table is on the same worksheet.

Is there a way for the pivot table to refresh when the <Enter> key is pressed after the source data is changed?

This is the code I am using if the PT is on a separate worksheet.

Private Sub Worksheet_Calculate()
Sheets("Sheet1").PivotTables("PivotTable1").RefreshTable

End Sub

Thanks
Sharron

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar