How do I get series of files to open from same folder

  • Thread starter Thread starter Ron McCormick
  • Start date Start date
R

Ron McCormick

I raised a query similar to this before and was given some
code along the follwoing lines:

Workbooks.Open FileName:=ThisWorkbook.Path
& "\userfile.xls"

The difference this time I am wanting to open a series of
files from the given folder. Any help would be
appreciated.

TIA
Ron
 
Ron,

You'd have to open them sequentially, using the same coding
that you were given:

Workbooks.Open FileName:=ThisWorkbook.Path & "\file1.xls"
Workbooks.Open FileName:=ThisWorkbook.Path & "\file2.xls"
Workbooks.Open FileName:=ThisWorkbook.Path & "\file3.xls"

Another option would be to save the open workbooks as a "Workspace"
Then whenever you open the workspace, all the files in the workspace
will be opened together.

John
 
How would we determine the series. Do you want to open all the files in
the folder, or those meeting certain criteria in terms of their name.

In any event, look at the sample for the Dir command in VBA. That is a good
start.
 
Back
Top