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!