Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Ron is offline
external usenet poster
 
Posts: 250
Default Adding button to worksheet to refresh pivot table data

I've created a daily input worksheet and it kicks out the results to a pivot
table. I want to create a button on that chart for the user to click on so
it can refresh data. Doing so just in case they don't have the pivot table
menu open, or forget to click in chart to bring up the refresh data button
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default Adding button to worksheet to refresh pivot table data

Hi Ron

Add the following code to the button on your sheet

Sub Refresh_Pivot()
ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh
End Sub

Change the name of the Pivot Table to the correct one for you.
To find the name, right click on your PTTable Options name will be shown
at top of dialogue.

Alternatively, rather than attaching code to a button, you could use a
worksheet event to cause the PT to be refreshed as soon as the tab is
selected.

Private Sub Worksheet_Activate()
ActiveSheet.PivotTables("PivotTable2").PivotCache. Refresh

End Sub

The above code needs to be copied, then right click on the sheet tab with
the PTView codePaste code into the white pane.

--
Regards
Roger Govier



"Ron" wrote in message
...
I've created a daily input worksheet and it kicks out the results to a
pivot
table. I want to create a button on that chart for the user to click on
so
it can refresh data. Doing so just in case they don't have the pivot
table
menu open, or forget to click in chart to bring up the refresh data button



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
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Formatting lost in a Pivot Table after a data refresh LordCommando Excel Worksheet Functions 3 April 10th 07 05:33 AM
Refresh Data Pivot Table Annabel Excel Discussion (Misc queries) 0 October 3rd 06 09:00 AM
Pivot table Data refresh SSD1 Excel Worksheet Functions 2 June 17th 05 09:13 PM
Pivot Table Data Refresh patemarie Excel Discussion (Misc queries) 1 December 1st 04 04:35 PM


All times are GMT +1. The time now is 10:36 PM.

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

About Us

"It's about Microsoft Excel"