Sub Tester3()
Dim cell As Range
Dim wkbk As Workbook
For Each cell In Range("A1:A500")
sName = "C:\Data\" & cell.Value & ".csv"
Set wkbk = _
Workbooks.Open( _
"http://chart.yahoo.com/table.csv?a=9&b=1&" & _
"c=2002&d=5&e=30&f=2004&s=" & _
cell.Value & _
"&y=0&g=d&ignore=.csv")
On Error Resume Next
' delete existing file with this name
Kill sName
On Error GoTo 0
wkbk.SaveAs FileName:=sName, _
FileFormat:=xlCSV
wkbk.Close SaveChanges:=False
Next
End Sub
--
Regards,
Tom Ogilvy
Me wrote in message
...
I'm fairly new to Excel and VBA.
Here is the situation:
1. I have a spreadsheet containing the symbols for the S&P500 index in
A2:A501.
2. I can download data for a single symbol using the yahoo website:
http://chart.yahoo.com/d?a=9&b=1&c=2...&f=2004&g=d&s=
which will give me a link at the bottom of the page to download 200
days of data in .CSV format.
3. I need to collect the data for all of the 500 symbols and save them
to a /DATA driectory as *.csv
4. I need to be able to do daily updates
5. I need to be able to automate this whole process
Any help appreciated