# Microsoft Office Application Help - Excel Help forum > Excel Programming / VBA / Macros >  >  Adding a Refresh button to a worksheet

## jamesda3asu

If I want to add a refresh button to a worksheet to update a web data query how would I do this?

----------


## Andy Pope

Did you try using the macro recorder.




```
Please Login or Register  to view this content.
```

----------


## jamesda3asu

I am fairly new to the more complicated features of excel and do not have a clue of how to do that with the macro recorder I was hoping for a step by step.

----------


## Andy Pope

Refresh web query:
with a cell within the return web query results use ribbon
Data > Connections > Refresh All > Refresh.

Create macro:
To record a macro use ribbon
Developer > Code > Record Macro.

(If the developer tab is not visible use
Office Button > Excel Options > Popular > Top Options for working with Excel > Show Developer tab in the Ribbon)

Once the recorder is started give the macro a sensible name like, RefreshMyWebQuery, and the record the action of refreshing a web query.

Add button:
To add a button to the sheet use ribbon
Developer > Controls > Insert > Form Controls > Button
Right click button and pick Assign Macro.
Select your newly created macro from the list.


Although given the button is there on the ribbon the creation of the button seems redundent.

----------

