manekankit
Board Regular
- Joined
- Feb 1, 2019
- Messages
- 72
- Office Version
- 365
- Platform
- Windows
Need help with macro to perform following task.
1. I have a file (Original file) with 6 sheets (Index, Report1, Report2, Report3, Report4 and Data)
2. Report1, 2, 3 and 4 sheets are linked through formulas to 'Data' sheet
3. Colum A in Index sheet contain list of sheets to be copied to a new book (e.g. it contains Report1, Report2 and Data in cells A1, A2 and A3 respectively). This list can increase or decrease.
Required:
1. Copy sheets listed in column A of Index sheet to a new workbook.
2. Save that new workbook with pre-defined name say'NewWB.xlsx'.
3. File should be saved to Original file path > Export > mmddyy (i.e. in the same path it should create 'Export' folder and in 'Export' folder it should create folder with dynamic name based on date(mmddyy) (eg. 11272022 for today) and file should be saved in this ddmmyy folder
4. Newly copied file should have pre-defined password ("ABC123").
Further my 'Data' sheet contains a table. If I manually move say Report1, Report2 and Data sheet, excel does not allow to move them together to a new sheet as 'Data' sheet contains a table. I have to move them all reports that i want to move first and then data file. New file should be such that formulas in Rport1, 2 etc. sheets are linked to 'Data' sheet in the new file itself.
Request you to help with macro code.
1. I have a file (Original file) with 6 sheets (Index, Report1, Report2, Report3, Report4 and Data)
2. Report1, 2, 3 and 4 sheets are linked through formulas to 'Data' sheet
3. Colum A in Index sheet contain list of sheets to be copied to a new book (e.g. it contains Report1, Report2 and Data in cells A1, A2 and A3 respectively). This list can increase or decrease.
Required:
1. Copy sheets listed in column A of Index sheet to a new workbook.
2. Save that new workbook with pre-defined name say'NewWB.xlsx'.
3. File should be saved to Original file path > Export > mmddyy (i.e. in the same path it should create 'Export' folder and in 'Export' folder it should create folder with dynamic name based on date(mmddyy) (eg. 11272022 for today) and file should be saved in this ddmmyy folder
4. Newly copied file should have pre-defined password ("ABC123").
Further my 'Data' sheet contains a table. If I manually move say Report1, Report2 and Data sheet, excel does not allow to move them together to a new sheet as 'Data' sheet contains a table. I have to move them all reports that i want to move first and then data file. New file should be such that formulas in Rport1, 2 etc. sheets are linked to 'Data' sheet in the new file itself.
Request you to help with macro code.