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

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
 
J

John Wilson

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
 
T

Tom Ogilvy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top