VBA newbie here. I'm starting with a single workbook that has 2 sheets. With this, I'm trying to figure out code that would accomplish the following on execution:
Any help would be greatly appreciated!
- Create an Array with n elements, where n is the number of Unique Strings found within the Cells in Column B (excluding B1 and blanks) from Sheet1 in the Source Workbook
- Populate the Array with each of these Unique Strings
- Enter a loop:
- Start with String Array(0)
- Create a new Target Workbook that is a Copy of Source Workbook
- Delete every Row in new Target Workbook EXCEPT
- Row 1 in both Sheet1 and Sheet2 (Headers)
- Rows in Sheet1 where Column B equals/contains String Array(0)
- Rows in Sheet2 where Column A contains (not equals!) String Array(0)
- Save new Target Workbook with filename matching Source Workbook's but prefaced by String Array(0) (same folder)
- Repeat for Array(1), Array(2)...Array (with n being the final element)
Any help would be greatly appreciated!