ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   vba yahoo! finance (https://www.excelbanter.com/excel-programming/272619-vba-yahoo-finance.html)

Arun Ram Kumaran

vba yahoo! finance
 
Is it possible to write a routine in VBA that can download current
stock prices from, say, Yahoo! Finance, and then update a workbook
with that information? If so, I'd appreciate any pointers on how to
do so.




Don Guillett[_4_]

vba yahoo! finance
 
This will do it. Contact me privately for more.

Sub getit()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.Calculation = xlCalculationManual
Set datasheet = ActiveSheet
With datasheet
Range("a3:a200").EntireRow.Delete
End With
qurl = "http://table.finance.yahoo.com/k?s=ibm&g=d"
With datasheet.QueryTables.Add(Connection:="URL;" & qurl,
Destination:=datasheet.Range("B7"))
.BackgroundQuery = True
.TablesOnlyFromHTML = False
.Refresh BackgroundQuery:=False
.SaveData = True
End With
Application.Calculation = xlCalculationAutomatic
Application.DisplayAlerts = True
End Sub

--
Don Guillett
SalesAid Software
Granite Shoals, TX

"Arun Ram Kumaran" wrote in message
...
Is it possible to write a routine in VBA that can download current
stock prices from, say, Yahoo! Finance, and then update a workbook
with that information? If so, I'd appreciate any pointers on how to
do so.







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

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