Copy a complete modulesheet from file to another file
Hello,
I see some difficult examples for copying a complete modulesheet from file to file. Perhaps somebody knows the best/easiest way.
I have a MASTER.xlsm (macro enabled) file. This file contains a modulesheet called BasicToCopy. This is the modulesheet I want to copy to another created file. Included is also another modulesheet which should contain the macro which can copy the sheet 'BasicToCopy' to the other file.
When I create a new xls file I want to copy the modulesheet 'BasicToCopy' from file MASTER.xlsm to this new created file (and then a have to save this file also as a xlsm file, but that is a manualy action because I have to think a file name).
So.... I have 2 open files. 1= My new created file, 2= MASTER.xlsm with 2 modulesheets (the one with the copy commandos, one with the to copy module).
When running the macro, then my new file is the active file;
1. Set ActiveFileName in memory.
2. GoTo MASTER.xlsm and copy module sheet 'BasicToCopy'
3. Back to the active file from step 1.
4. Insert/Paste the complete module 'BasicToCopy' in the file from step 1.
Thats all :)
But know in a working code.
So if somebody things... yes, this is a nice one to create. Feel free (and make me happy).
regards, Johan
|