ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatic Update links to web query (https://www.excelbanter.com/excel-programming/417165-automatic-update-links-web-query.html)

Alfredo_CPA

Automatic Update links to web query
 
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60 seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the refresh
option is available just when I'm in sheet2. Are there any way to refresh the
web query from sheet1




--
I'm not a looser, I keep trying€¦

Excel.Instructor

Automatic Update links to web query
 
On Sep 16, 3:24*pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60 seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the refresh
option is available just when I'm in sheet2. Are there any way to refresh the
web query from sheet1

--
I'm not a looser, I keep trying…


Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)

Don Guillett

Automatic Update links to web query
 
Just edit your query data range properties

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Excel.Instructor" wrote in message
...
On Sep 16, 3:24 pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60 seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the
refresh
option is available just when I'm in sheet2. Are there any way to refresh
the
web query from sheet1

--
I'm not a looser, I keep trying…


Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)


Alfredo_CPA

Automatic Update links to web query
 
This code gives me an error message:
Worksheets("NFL Link").Range("J30").Select
I Can't figure out what is wrong...

--



"Excel.Instructor" wrote:

On Sep 16, 3:24 pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60 seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the refresh
option is available just when I'm in sheet2. Are there any way to refresh the
web query from sheet1

--
I'm not a looser, I keep trying€¦


Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)


Don Guillett

Automatic Update links to web query
 
You must either select the sheet and THEN select the range or use
application.goto

application.goto Worksheets("NFL Link").Range("J30")
If desired, send your workbook to me and I'll have a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
This code gives me an error message:
Worksheets("NFL Link").Range("J30").Select
I Can't figure out what is wrong...

--



"Excel.Instructor" wrote:

On Sep 16, 3:24 pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60
seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the
refresh
option is available just when I'm in sheet2. Are there any way to
refresh the
web query from sheet1

--
I'm not a looser, I keep trying€¦


Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)



Alfredo_CPA

Automatic Update links to web query
 
My code now looks like:

Sub UpdateWeb()
application.goto Worksheets("NFL Link").Range("J30")
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Now I need a code to go back to the original sheet (which name will change -
i.e. the name will not be always the same). In this way I can update the
links from a different sheet with just one click.

Thanks

--
I''''''''m not a looser, I keep trying€¦


"Don Guillett" wrote:

You must either select the sheet and THEN select the range or use
application.goto

application.goto Worksheets("NFL Link").Range("J30")
If desired, send your workbook to me and I'll have a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
This code gives me an error message:
Worksheets("NFL Link").Range("J30").Select
I Can't figure out what is wrong...

--



"Excel.Instructor" wrote:

On Sep 16, 3:24 pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60
seconds.

2. My web query is in sheet2 (showed as raw data). My usefull (already
manipulated data) with links to sheet 2 is in sheet1. I noticed the
refresh
option is available just when I'm in sheet2. Are there any way to
refresh the
web query from sheet1

--
I'm not a looser, I keep trying€¦

Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)




Don Guillett

Automatic Update links to web query
 

As I said, feel free to send your workbook to my address below so I can
understand what is going on.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
My code now looks like:

Sub UpdateWeb()
application.goto Worksheets("NFL Link").Range("J30")
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Now I need a code to go back to the original sheet (which name will
change -
i.e. the name will not be always the same). In this way I can update the
links from a different sheet with just one click.

Thanks

--
I''''''''m not a looser, I keep trying€¦


"Don Guillett" wrote:

You must either select the sheet and THEN select the range or use
application.goto

application.goto Worksheets("NFL Link").Range("J30")
If desired, send your workbook to me and I'll have a look.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Alfredo_CPA" .(donotspam) wrote in message
...
This code gives me an error message:
Worksheets("NFL Link").Range("J30").Select
I Can't figure out what is wrong...

--



"Excel.Instructor" wrote:

On Sep 16, 3:24 pm, Alfredo_CPA .(donotspam)
wrote:
1. Are there any way to Automatic Update links to web query.
Let say, I want to simulate clicking the refresh button every 60
seconds.

2. My web query is in sheet2 (showed as raw data). My usefull
(already
manipulated data) with links to sheet 2 is in sheet1. I noticed the
refresh
option is available just when I'm in sheet2. Are there any way to
refresh the
web query from sheet1

--
I'm not a looser, I keep trying€¦

Alfredo-

Here is a macro that will do the job. You'll need to replace the
"B15" cell reference with any cell on your Sheet2 that contains data
from the web query. Basically, if you can right click that cell and
the Refresh option appears, it's usable in this macro.

Sub UpdateWeb()
Worksheets("Sheet2").Range("B15").Select
Selection.QueryTable.Refresh BackgroundQuery:=False
End Sub

Regards,
Excel.Instructor (Ed2go.com/Advanced Excel)






All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com