novice_2010
Board Regular
- Joined
- Mar 18, 2010
- Messages
- 105
dear all
I want to describe my question by using an example:
Let's say, I want to get Microsoft stock historical price. I can go to yahoo finance:
http://finance.yahoo.com/q/hp?s=MSFT
and click the "Download To Spreadsheet ",
I can also use Excel VBA to do the same thing:
The following is an tentative macro:
Could anyone please help me how to make this macro work?
I want to describe my question by using an example:
Let's say, I want to get Microsoft stock historical price. I can go to yahoo finance:
http://finance.yahoo.com/q/hp?s=MSFT
and click the "Download To Spreadsheet ",
I can also use Excel VBA to do the same thing:
Now, my question is: I want to use a variable to denote the stock (MSFT as in the above example) so that I can use this sub to open any stock.Sub Macro1()
Workbooks.Open Filename:= _
"http://ichart.finance.yahoo.com/table.csv?s=MSFT&d=2&e=18&f=2010&g=d&a=2&b=13&c=1986&ignore=.csv"
End Sub
The following is an tentative macro:
However this macro doesn't work for me.Sub Macro1()
dim StockTicker as String
StockTicker = MSFT
Workbooks.Open Filename:= _
"http://ichart.finance.yahoo.com/table.csv?s=StockTicker
&d=2&e=18&f=2010&g=d&a=2&b=13&c=1986&ignore=.csv"
End Sub
Could anyone please help me how to make this macro work?