I have a spreadsheet that has 2 columns, the first is a unique identifier, the second is a list delineated by the ‘|’ character of people assigned to that case. I am attempting to write a macro that uses text to columns to break out the second column into multiple columns and then copy them all with the corresponding identifier to the bottom of the original columns. I am dealing with about 46,000 rows, and the result will have around 70,000 I would guess. An example is as follows:
Original Data
ColumnA ColumnB
123 Adam | Jill | Bob
456 Brent | Bob | Betsy | Sam
789 Matt | Adam | Jill
Needed Data
ColumnA ColumnB
123 Adam
456 Brent
789 Matt
123 Jill
456 Bob
789 Adam
123 Bob
456 Betsy
789 Jill
456 Sam
I think this should do what you want:
Adjust the inputRng and outputRng to point where you want
All the code does is split the string value in VBA and iterate over that list then move down onto the next row. It keeps going until it finds an empty (Value == “”) cell and then stops.