VBA Code To Import Historical Stock Quotes In Excel

V

Validea1

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.
 
B

braden

Does it matter if you use Yahoo!Finance? I find BigCharts.Com'
historical quote feature much easier to use, unless you are trying t
download a series of historical prices -- like the closing prices of K
from 1/31/96 to present. Let me know and I will attempt to help yo
out
 
M

manhuber

That can easily be done with the DLL MetaLib from
http://www.trading-tools.com

You only have to use following code in your Excel sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Column = 1 Then
Dim iquotes As New MLInternetQuotes
iquotes.DownloadQuotes Target.Cells(Target.Row, 2), US
Target.Cells(Target.Row, 3) = iquotes.dClose
End If
End Sub
 

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