I searched to see if there were any examples, but here I am and this is what I need to accomplish:
I need to insert the current real time stock numbers into Worksheets("BackTest").Range("A2:G2") so that my worksheets can calculate the data up to the current time instead of waiting until 8 or 9PM at night, when Yahoo updates their history dB. This way, during trading hours, if there is a "BUY or SELL" flag that comes up, I can "BUY or "SELL" while the market is still open and not at 8PMish when the Yahoo information becomes available.
Based on the 2007 version of Excel (Webservice does not work in 2007 version), The format will be the same as the Historical Stock data.
- WorkBook = Stock_Program.xlsm
- WorkSheet = Worksheets("BackTest").Range("A2:G2") (where the data goes)
- StockSymbol = SettingsSheet.Range("E4")
A1 through G1 are the Historical Data Column Names (Automatically populated)
A2 = Date (Yahoo = "d2")
B2 = Days Opening Stock Price (for that day) (Yahoo = "o")
C2 = Days High Stock Price (for that day) (Yahoo = "h")
D2 = Days Low Stock Price (for that day) (Yahoo = "g")
E2 = Last Trade (Yahoo = l1)
F2 = Current Stock Volume (Yahoo = "v")
I will insert this macro into the code right after the Macro that clears the cells and inserts header in the first row and before the Macro that downloads and inserts the History stock history data into the worksheet starting at A3.
The only other way I can figure out to do it is to insert a formula (hyperlink) into each cell, but you then have to click on each one to get the updated info.
... Example... (http://finance.yahoo.com/d/quotes.cs...E4&%22&f=l1%22)
But that is not a doable solution.
Any thoughts? Options?
Thanks in advance,
Don
Bookmarks