Hi all,
I'd like a macro which will:
1. create new sheets based on the text in Column A of the active sheet (source sheet) of where the macro is run
2. save just the new sheets which have been created as csv files in a new folder, with the folder name as date of when the macro is run.
I've attached an example workbook which hopefully highlights what I'm trying to achieve in step 1.
Here's some other specifics of what the macro should do, please:
- Shouldn't require a specific source sheet name, instead should work on whichever sheet is active i.e. whichever sheet I'm on when I run the macro
- Should not copy hidden columns from source sheet
- If there are duplicate values in Column A in the source sheet, then should be added to 1 single sheet (please see the attached workbook as an example)
- Create a folder with today's date in format 'dd.mm.yyyy' e.g. 21.05.2023. The location of the folder should be 'C:\Users\kevin\Work'. This is where the new csv's should be saved.
- It should also copy the visible headers from Row 1 on whichever source sheet the macro is being run.
Please note:
The data on source sheet will go to Column Z at the most (including the hidden columns), but will vary on each source sheet i.e. some sheets the data may go to Column Q, another one may go to Column S and another possibly all the way to Column Z. There data will go down to a maximum of 250 rows on any given source sheet.
The data in the attached workbook is example data and the actual structure of the text in each cell will be completely different (not that this should hopefully make a difference to create this macro).
Many thanks,
Kevin
P.s. I'm a novice at using macros - just know how to insert and run one!
Split Data To Sheets Example.xlsx
Bookmarks