ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Code To Import Historical Stock Quotes In Excel (https://www.excelbanter.com/excel-programming/335887-vba-code-import-historical-stock-quotes-excel.html)

[email protected]

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.


braden[_5_]

VBA Code To Import Historical Stock Quotes In Excel
 

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

--
brade
-----------------------------------------------------------------------
braden's Profile: http://www.excelforum.com/member.php...fo&userid=2522
View this thread: http://www.excelforum.com/showthread.php?threadid=39134


[email protected]

VBA Code To Import Historical Stock Quotes In Excel
 
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



All times are GMT +1. The time now is 01:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com