View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] manhuber@gmx.de is offline
external usenet poster
 
Posts: 2
Default VBA Code To Import Historical Stock Quotes In Excel

Does anyone know/are able to write a VBA code that would let the user
type in a date and ticker symbol and have excel automaticly grab the
historical quote off of Yahoo!Finance ? i.e. type "8/29/2005" in A1 and
"MSFT" is B1 and have the adj. Close appear in C1... Any help would be
greatly appreciated.


Take a look at http://www.trading-tools.com
With the product "MetaLib" you can download historical stock quotes
from Yahoo and import them in Excel. Here is a sample code:

Dim IQuotes As New MLInternetQuotes
IQuotes.DownloadQuotes "MSFT", US
Sheets(1).Range("A1").Value = IQuotes.iDate
Sheets(1).Range("B1").Value = IQuotes.dOpen
Sheets(1).Range("C1").Value = IQuotes.dClose
Sheets(1).Range("D1").Value = IQuotes.dVolume

etc.