Refreshing a Pivot table

J

Joey

Hi all

I need some help with creating a hyperlink type button to refresh
pivot table.

Any help with this will be extremely appreciated


Many thanks
Yusu
 
D

davers

The following code will autmatically refresh a pivot table when yo
select the worksheet that contains the pivot table and fit the column
to the correct size.


Code
-------------------

Private Sub Worksheet_Activate()

Set pvtTable = Worksheets("Sheet1").Range("A3").PivotTable
pvtTable.RefreshTable
Worksheets("Sheet1").Range("C:p").Columns.AutoFit

End Su
-------------------


This would get pasted into the Worksheet Object that corresponds to th
worksheet your pivot table is on. In this case, the pivot table is o
Sheet1 and the data range is from column C:p...

Hope this helps,

Dav
 
I

icestationzbra

just wondering why you would want a hyperlink sort of button. if yo
right-click on a pivot sheet, the context menu would contain a re
exclamation mark (Refresh Data). click on that to refresh the pivo
table
 
Top