Macro to refresh pivot tables

mzspazchick

New Member
Joined
Nov 10, 2005
Messages
39
Hi All,
I need to create a macro that will allow a user to click a button that says "Refresh Data". When that button is clicked I need two worksheets of pivot tables to refresh. Is this possible? I have never created a macro before, or a button.
The user will be entering data into a certain place on a worksheet, then they will be going to another worksheet, clicking the button and waiting to see results. Everything is in the same workbook and all the cell references, formulas, etc are set up, I am just stuck on the button.
I would greatly appreciate any help you can offer.
Thanks,
Michelle
:help:
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I use this code to refresh all pivot tables in my workbook

Sub Update()

'Refresh all pivot tables
ActiveWorkbook.RefreshAll

End Sub

In the forms toolbar, select the "button" button. Then draw the button on your sheet and select new. Paste the code above into the vba module and press ok. Right click on the button and select Assign Macro and press ok. This should set up your button to use.
 
Upvote 0

Forum statistics

Threads
1,225,071
Messages
6,182,685
Members
453,132
Latest member
nsnodgrass73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top