Open and close workbooks


J

JOSEPH WEBER

I want to set up a macro that will activate a workbook, copy the info in
specified fields and paste it to the master workbook, then close the original
workbook. I can't figure out how to do this, because I won't know the name of
the workbook that will be activated. I set up a macro that adds a new
workbook and names it based on a cell value and then saves it in a specific
folder. I want to go in that folder, open up all of the workbooks and then
activate the macro that will copy info to the master workbook. Please help
 
Ad

Advertisements

S

sali

JOSEPH WEBER said:
folder. I want to go in that folder, open up all of the workbooks and then
activate the macro that will copy info to the master workbook. Please help

after you open your workbooks from specified folder, just do the collection
scan, like:

--------
n = 0
msgbox "total of [" & workbooks.count & "] workbook(s) openned"
for each wb in workbooks
n = n +1
msgbox "workbook [" & n & "] in memory: " & wb.name
next
--------
 

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