
Originally Posted by
B2009
1. Aren't you supposed to define what ChDir is?
The command given in the code is correct. ChDir is an operating system setting, changes the working directory. Since I listed the string to change to, we have defined it.
If what you mean is "don't you have to edit that string so that it's accurate"? Yes, you do. That's why I highlighted it.
2. Where do you specify the worksheet within the workbook that you are interested in copying across?
Based on your indication that is was Sheet1, I used the "Sheet1.Activate" to make that the active sheet in each workbook.
You can do that many ways:
3. Is it possible to add to the Macro to automatically name the tab of the worksheet that is carried across - maybe make the name of the tab referenced to a cell reference within the worksheet?
Everything is possible.
Currently the macro is copying data across and adding it into a single table. There are no inclusions for tab names.
Are you saying your "Sheet1" has a different name each time? If so, then you definitely want to use the line I highlighted in red above for activating the sheet.
If you provide some information about WHERE exactly in the master workbook you would want to see the tab name from the copied workbooks to appear, I can suggest some changes.
Remember, I can't see your sheet so explain completely what you're wanting, or post before/after examples.
Bookmarks