Web Query for Stock Quotes

J

Jamie Vail

I would like to have a web query that pulls the stock price for a given
stock symbol. The one from MSN money pulls all the data (I just want a one
column with the current prices of my stocks). I have tried Yahoo Finance,
however, I have only been able to get it to respond with the current price
and the symbol in the same field. I have copied below what I have tried
writing. Also, is it possible to have multiple stock symbols in here, and
the script runs through each one, keeping it in the same column, just going
down the rows?

WEB
1
http://finance.yahoo.com/d/quotes.csv?s=MOT&f=sl1
<http://finance.yahoo.com/d/quotes.csv?s=MOT&amp;f=sl1>

Thanks
 
B

brinded

I'm also having problems with yahoo quotes - I am a novice at web
queries so please bear with me.
I've read Jim Gordon's page and understand the basics and have created
text files that work to an extent but am still having difficulty with
yahoo quotes.
Using the query given in topic:
WEB
1
http://finance.yahoo.com/d/quotes.csv?s=MOT&f=sl1
<http://finance.yahoo.com/d/quotes.csv?s=MOT&f=sl1>

I get a cell filled with the msg "Missing Symbols List."
Which cell should I put the symbols in? I can't tell from above code
where the reference is to.
 
B

brinded

progress...

I've managed to get the query to respond as described by Jamie in
original post - "with the current price and the symbol in the same
field."
I'd still like to be able to create a list and have the values
separated.

Any help appreciated.
 
B

brinded

progress...

I've managed to get the query to respond as described by Jamie in
original post - "with the current price and the symbol in the same
field."
I'd still like to be able to create a list and have the values
separated.

Any help appreciated.
 
J

Jim Gordon MVP

Hi,

Excel has a built-in feature that does text to columns. You can record a
macro that accomplishes the text to columns. You'll get something like this:

Selection.TextToColumns Destination:=Range("A1"),
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False,
Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False,
FieldInfo _
:=Array(Array(1, 1), Array(2, 1))

You might be able activate that macro code when the data is refreshed
using the AfterRefresh Event.

I'm too sleepy to put it all together at the moment, but it can be done.

-Jim
 
B

brinded

Thanks Jim,

I'm keen to learn so I'll try play with this over the next few days and
see what I can create.

regards, David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top