Hi all,
Hoping you can help with VBA for the below - been trying to work it out based on other threads but unable to do so.
I have two workbooks:
- One is an 'input' workbook. This has multiple columns (some numbers, some text), running from Column A - Column I (row length will vary) but the important one is Column G. Column G will have text (say e.g. there are 5 rows; 2 might be Called "Text1", 2 "Text2" and 1 "Text3")
- The second workbook is a 'template' workbook. The first sheet in this workbook is called 'Input', and has the exact same column headers as the input workbook above.
What I'm looking for is a macro which:
- Identifies all unique values in the 'input' workbook (so, Text1; Text2; Text3)
- For each unique value identified, generates one copy of the 'template' workbook, with the generated workbook named 'Text1'; 'Text2'; 'Text3' as applicable
- Copies all data from the 'input' workbook into the input sheet in the relevant 'template' workbook (e.g., if Row 2 and 4 were 'Text1' in Column G in the input workbook; copy all of Row 2 and Row 4 into the input sheet in the Text1 template workbook)
If it's easier to combine the two workbooks (so that the 'input' workbook essentially becomes the first sheet in the 'template' workbook, and from that a macro which essentially splits that up into various workbooks aligned with unique values in Column G), that would work also.
Hoping I've explained properly. Any assistance greatly appreciated!
Cheers
Hoping you can help with VBA for the below - been trying to work it out based on other threads but unable to do so.
I have two workbooks:
- One is an 'input' workbook. This has multiple columns (some numbers, some text), running from Column A - Column I (row length will vary) but the important one is Column G. Column G will have text (say e.g. there are 5 rows; 2 might be Called "Text1", 2 "Text2" and 1 "Text3")
- The second workbook is a 'template' workbook. The first sheet in this workbook is called 'Input', and has the exact same column headers as the input workbook above.
What I'm looking for is a macro which:
- Identifies all unique values in the 'input' workbook (so, Text1; Text2; Text3)
- For each unique value identified, generates one copy of the 'template' workbook, with the generated workbook named 'Text1'; 'Text2'; 'Text3' as applicable
- Copies all data from the 'input' workbook into the input sheet in the relevant 'template' workbook (e.g., if Row 2 and 4 were 'Text1' in Column G in the input workbook; copy all of Row 2 and Row 4 into the input sheet in the Text1 template workbook)
If it's easier to combine the two workbooks (so that the 'input' workbook essentially becomes the first sheet in the 'template' workbook, and from that a macro which essentially splits that up into various workbooks aligned with unique values in Column G), that would work also.
Hoping I've explained properly. Any assistance greatly appreciated!
Cheers