|
-
May 30th, 2006, 01:25 PM
#1
Thread Starter
New Member
[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
-
May 30th, 2006, 01:28 PM
#2
Re: Opening Multiple files
.....2006\2006-000" & i & ".XLS",
you need the & symbol in there...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
May 30th, 2006, 07:20 PM
#3
Re: Opening Multiple files

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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|