![]() |
Activating workbook without naming it specifically
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 |
Activating workbook without naming it specifically
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. Patrick Young wrote: 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 |
All times are GMT +1. The time now is 11:55 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com