Run Macro On Multiple Closed Workbooks

A

Andy

I have a file named Master.xls with a list of numbers in col A that refer to
the names of thousands of text (nnnnnnn.log) files in the same folder as
Master.xls.
I have a macro to extract the data that I need from the log file (when I
open the log file in Excel), format and tabulate the data ready to export to
a databse, but, but I do not relish the thought of having to repeat the
process of open file, run macro, close file thousands of times.
Can anyone suggest how i could run this macro for each nnnnnn.log file
listed in col A of Master.xls ?
I'm sure the answer is pretty simple but then so am I!
 
W

Walt

Hi Andy,

There's a good example of the DIR Function in the VBA help system.
Within the loop described, you can test against your listing and open &
process where appropriate. I think it will get you there.

Best Regards,
Walt Weber
 

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