Stock prices into excel

A

Andreas Ingo

I would really appreciate if someone could help me with some code that makes
excel import stock prices from a home page on an intra-daily basis, e.g.
every 5th or 10th minute. I do not want to have time series data, it is
enough if one cell is updated each time with the current price.

Furthermore I would like excel to give a pop-up/notice every time a cell in
the sheet is larger/less than a specific trigger which always is a number. It
is important that the pop-up always will be seen, i.e. so it does not lay
behind other windows.

I would really appreciate if someone could help me with this.

/Andreas
 
D

Don Guillett

I have set up similar projects for clients but an easy way to do it is to
goto
http://finance.yahoo.com/
my portfolios>set up one. You get 15 minute delayed quotes showing up in
green and dn in red that change with each trade. Very flexible on what to
show.
 
A

Andreas Ingo

I saw that there was a built-in function in Excel getting stock quotes from
MSN, but it did not work with Swedish stocks. Is it possible to do the same
with yahoo?

Is there any solution for my 2nd question?

Thanks

/Andreas
 
A

Andreas Ingo

I found this code on this website, it works quite well except that I do not
know how to get it to update regularly, everyt 5 minutes or so, and how I
apply this code when I want to have more than one stock. Now, when I run the
macro it only updates one stock while the second stock is left blank.
Someone?:


Rows("2:65536").Select
Selection.ClearContents
Range("A1").Select

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://finance.yahoo.com/q?s=" &
Range("A1"), Destination:=Range("A2"))
.Name = "q?s=" & Range("A1")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = """table1"",""table2"""
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
 
D

Don Guillett

Have you tried Yahoo? What are some tickers for the stocks?

goto
(e-mail address removed)
and look in the files section. There are several free files.
I have a couple of free files under author donalb36
 
D

Don Guillett

This code would have to be modified to loop from a list of tickers>delete
the defined names created each time>and also be modified to use ONTIME to
update when desired. Did you try my free file or the yahoo portfolio I
suggested.
 
A

Andreas Ingo

Ok, I had a look, but the thing is that there are some reasons to why I need
it in Excel and cannot have it in a portfolio on the internet.

Is it possible that you could help me to loop the code I found so it works
on more stocks and to get it to refresh every 5 minutes or so?

I would really appreciate it!

Andreas
 
J

Jon Peltier

That's an email address, see the "at" sign? I imagine if you send an email,
you'd receive information on how to access the group.

- Jon
 
R

ryguy7272

Probably, the most sensible way to do it is to capture data for each stock on
a ea separate sheet (that's how I do it). make the sheet name the name of
the stock. You can refresh all data in all sheets easily. Take a look at
this resource:
http://www.cpearson.com/excel/OnTime.aspx

Regards,
Ryan--

It can get very technical. If you want more information email me at:
(e-mail address removed) (remove the xxx part).
 
D

Don Guillett

Capturing each stock on a separate sheet is NOT efficient. Join the group
and get my file (Yahoo multiple quotes) which updates a long list of symbols
"lickety split". Or, send me a PRIVATE email and I will email to you. Never
mind, I sent a copy to the address you gave below.
 
A

Andreas Ingo

Dear Don

Sorry for the misunderstanding, would it be possible for you to send it to
(e-mail address removed), removing the XXX? I would really appreciate it.
Andreas
 
A

Andreas Ingo

Dear Don

I have found your file for Yahoo. The problem is that it is not possible to
write my tickers. E.g. secub.st which is available at yahoo finance's
homepage cannot be inserted into the ticker box in your excel sheet. Any
ideas how to solve it?

Best regards

Andreas
 
A

Andreas Ingo

I've got it work now, but experience a common problem. I do not want to have
.. instead I would like to have , between the numbers. I know I can change in
alternatives to . but I would like to have , is this possible to solve
somehow?
 

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