LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 135
Default Excel macro to get stock quotes off the www

This procedure uses a list of symbols in the first column of the first sheet
in the workbook and gets basic quotes from Yahoo.
The max number of quotes is 20-30 per access-I keep the limit at 20. You
can loop the procedure to get as many quotes as you like.


HTH, Shockley


Sub GetYQuotes()
Base01 = "http://finance.yahoo.com/d/quotes.csv?s="
Base02 = "&f=sl1d1t1c1ohgv&e=.csv"

sURL = ""
SymString = ""
LastRow = Cells(65536, 1).End(xlUp).Row
For i = 1 To LastRow
SymString = SymString & Cells(i, 1) & " "
Next i
sURL = Base01 & SymString & Base02
Workbooks.Open sURL
Set rngSource = Cells(1).CurrentRegion
x = rngSource.Rows.Count
y = rngSource.Columns.Count
With ThisWorkbook.Sheets(1)
Set rngDest = Range(.Cells(1, 1), .Cells(x, y))
End With
rngDest.Value = rngSource.Value
ActiveWorkbook.Close SaveChanges:=False
End Sub



"Bob Benjamin" wrote in message
...
How can I write a macro to go to
a stock quote web page on the Internet
and download to a Excel spreadsheet
the values?

Are there any already written macros somewhere
(in a book, on the internet etc) that I could modify to do this?




 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MSN Stock Quotes add-in for excel acapriles Excel Discussion (Misc queries) 1 May 3rd 10 11:16 PM
Stock quotes in Excel JD Excel Worksheet Functions 6 October 4th 08 02:01 AM
How do i get historical stock quotes using MSN Money Stock Quotes Ash Excel Discussion (Misc queries) 0 May 11th 06 03:26 AM
How do I get stock quotes in Excel without text? m_man Excel Worksheet Functions 1 June 22nd 05 05:47 AM
Stock quotes:Excel mr.lee Excel Programming 0 October 29th 03 01:50 PM


All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"