Refreshing a Pivot table

  • Thread starter Thread starter Joey
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top