webquery; input query value from excelsheet

damaq

New Member
Joined
Oct 6, 2014
Messages
3
I'm working on the realization of a Web query in C: \ Program Files (x86) \ Microsoft Office \ OFFICE11 \ QUERIES is a great example (VBA):

"Sub URL_Static_Query()

With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://quote.money.cnn.com/quote/quote?symbols=msft", _
Destination:=Range("a1"))

.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With
End Sub"

This query becomes dynamic when "URL, http: //quote.money.cnn.com/quote/quote symbols = msft?", _ to is replaced by the
"URL, http: //quote.money.cnn.com/quote/quote symbols = [" "Parameter1" "," "description parameter present, fill in msft" "]", _ parameter1
which is requested on a popup form quoting the text "description parameter present ... etc"

Now my question. I need a piece of vba code that is able to extract values (or text) from the excel spreadsheet and use these values as input for the webquery. I'm looking for a way to use values from a list in the spreadsheet
For example, a1 has value "dow", a2 has "nasdaq" a3 in yet another code.


The vba code I'm looking for works its way down the list and executes the query for each value found in the list. It puts the results for example 10 rows below the results found with the previous value.


Who can help me out?


Best regards, Damaq
 

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Watch MrExcel Video

Forum statistics

Threads
1,109,042
Messages
5,526,420
Members
409,701
Latest member
nitmani

This Week's Hot Topics

Top