VBA Code To Import Historical Stock Quotes In Excel

  • Thread starter Thread starter Validea1
  • Start date Start date
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.
 
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
 
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
 
Back
Top