VBA Code To Import Historical Stock Quotes In Excel

M

manhuber

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.
 

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