Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

Command Button to refresh Pivot tables

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron - 17 Oct 2007 05:22 GMT
In case the users I will be sending my sheet to, don't have their pivot table
selected, how can I insert a command button that refreshes data, without them
having to select the red !

Thanks
Jon von der Heyden - 17 Oct 2007 13:13 GMT
You can add a button from Forms:
   View > Toolbars > Forms.
   Then drag and drop "Button onto the sheet"

   Then hit Alt+F11 > Insert > New Module
   Add this code
   Sub RePvt()
        ActiveWorkbook.RefreshAll
   End Sub

   Go back to the button > right click > Assign Macro > RePvt

Note, this will refresh ALL pivot tables in the workbook.

Regards
Jon
Signature

Email: subst1tut3 numb3rs for l3tt3rs...

> In case the users I will be sending my sheet to, don't have their pivot table
> selected, how can I insert a command button that refreshes data, without them
> having to select the red !
>
> Thanks
troy@eXL - 17 Oct 2007 13:34 GMT
> In case the users I will be sending my sheet to, don't have their pivot table
> selected, how can I insert a command button that refreshes data, without them
> having to select the red !
>
> Thanks

Hi Ron,

Try using this line of code in the macro assigned to your button:

ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh

cheers,
troy.

Unprotect Any Spreadsheet... Without The Password... In Just Seconds
Get eXL_unProtect today for less than you'd pay for lunch!
www.eXtreme-eXcel.com
Don't Let Anyone Lock You Out Of A Spreadsheet Again!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.