[RESOLVED] Opening Multiple files
I am trying to write a macro in Excel to copy data from a same cell in several different spreadsheets. All of the spreadsheets are located in the same folder in my computer. The spreadsheets are named 2006-00001, 2006-00002, 2006-00003, ...., 2006-99999. To complete this task, I am trying to do a loop to open each spreadsheet:
For i=1 to i=9:
Workbooks.Open Filename:= _
"\\brasms115\wwreports\In Process\2006\2006-0000" i ".XLS", UpdateLinks:=0
For i=10 to i=99:
Workbooks.Open Filename:= _
"\\brasms115\wwreports\In Process\2006\2006-000" i ".XLS", UpdateLinks:=0
etc...
However, I am getting the following error with reference to the i:
Compile error:
Expected: end of statement
Does anyone know the proper way to do this?
Any and all help much appreciated!
Thank you,
Ed
Re: Opening Multiple files
.....2006\2006-000" & i & ".XLS",
you need the & symbol in there...
Re: Opening Multiple files
http://www.vbforums.com/
Please use [vbcode] your code goes in here [/vbcode] tags when posting code.
When you have received an answer to your question, please mark it as Resolved using the Thread Tools menu.http://www.vbforums.com/images/ieimages/2004/12/1.gif