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/339714-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.


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.



All times are GMT +1. The time now is 11:00 PM.

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