Refresh Button

philiplynch

New Member
Joined
Aug 20, 2007
Messages
11
I have an excel spreadsheet page that takes data from one page to come up with calculations on another. Anyway, you have to Right-Click and press Refresh Data. Is there a way to create a button that just says Refresh or Update or whatever that does the same as Refresh Data, but is there as a easy to see and click button. Thanks for your help in advance.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Create a command button from the "Control Toolbox" Toolbar.

right click it, view code.

you will see some code there already, something like

Code:
Private Sub CommandButton1_Click()

End Sub

Put these lines between those 2 lines.

Code:
Sheets("sheet1").Range("A1").QueryTable.Refresh

Adjust sheetname and A1 to suit.
 
Upvote 0

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
View - Toolbars....
if not on that list, select customize - and put a check next to "Control Toolbox"
 
Upvote 0

Datsmart

Well-known Member
Joined
Jun 19, 2003
Messages
7,985
From Excel Help:
"Display the Control Toolbox: point to Toolbars on the View menu, and then click Control Toolbox."
 
Upvote 0

philiplynch

New Member
Joined
Aug 20, 2007
Messages
11
I tried to have things automatically refresh, but windows keeps having a message about how a macro could contain viruses, and this is going to other people, and I dont want them to see that message.

Is there a way to create a Refresh button? There would be a standard button that when clicked, would refresh the table and doesn't use macros. Thanks.
 
Upvote 0

Forum statistics

Threads
1,191,204
Messages
5,985,262
Members
439,953
Latest member
suchitha

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
Top