Activating workbook without naming it specifically

P

Patrick Young

I have a master budget workbook from which I am copying different ranges
from different worksheets to the corresponding ranges and worksheets in
identically built branch budget workbooks. I want to do this automatically
for each of the 20 Branch Budget Workbooks, without having to enter the
names of the Branch Budget Workbooks each time to open them, and keep them
activated until the steps 1 and 2 below are completed for each branch. How
do I code this?

The steps are as follows:-

1.
Open Master Budget Workbook

2.
Select Worksheet, Range and Copy
Open Branch Budget Workbook 1
Select Worksheet, Range and Paste

3.
Activate Master Budget Workbook
Select Worksheet, Range and Copy
Activate Branch Budget Workbook 1
Select Worksheet, Range and Paste
Close and save Branch Budget Workbook 1

4.
Activate Master Budget Workbook
Repeat steps 2 and 3 for each of the remaining 19 Branch Budget Workbooks

5.
Close Master Budget Workbook

Thanks for your help,


Patrick
 
G

Gareth

To get your code for just one iteration you should record a macro as you
perform the task manually.

Then, to iterate, you need to come up with some way of telling Excel
what files to open, either by telling it to take all the files from a
particular directory (maybe with a wildcard filter too), hardcode the
actual filenames or maybe only those workbooks with a certain value in
the Workbook properties.

If you post the code you have so far that would help.
 

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