Morning all
I have a workbook with quite a few web queries and for which I want to record a web refresh macro for. If I record the macro and right click on the first set of data and select refresh data will it refresh all of the web queries or only that one?
Web refresh macro (2003 SP3)
-
- SilverLounger
- Posts: 1952
- Joined: 26 Jan 2010, 12:46
- Location: Nr. Heathrow Airport
Web refresh macro (2003 SP3)
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
-
- Administrator
- Posts: 78532
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Web refresh macro (2003 SP3)
The recorded macro would act on one web query only - the one selected when you run the macro.
Here is a macro that will update all external data in a workbook:
Here is a macro that will update all external data in a workbook:
Code: Select all
Sub UpdateAllWebqueries()
Dim wsh As Worksheet
Dim qtb As QueryTable
Application.ScreenUpdating = False
For Each wsh In ActiveWorkbook.Worksheets
For Each qtb In wsh.QueryTables
qtb.Refresh BackgroundQuery:=False
Next qtb
Next wsh
Application.ScreenUpdating = True
End Sub
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1952
- Joined: 26 Jan 2010, 12:46
- Location: Nr. Heathrow Airport
Re: Web refresh macro (2003 SP3)
Hi HansHansV wrote:The recorded macro would act on one web query only - the one selected when you run the macro.
Here is a macro that will update all external data in a workbook:
Fantastic as usual, the Christmas hamper is getting bigger and bigger!!
Steve
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
http://www.freightpro-uk.com" onclick="window.open(this.href);return false;
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin