Hi there,

This is probably really simple, but.. I can't figure it out so far

I have a large chunk of data that looks something like this:

Mary CS208515
Mary CS208518
Mary CS308520
Susan HE501924
Lisa DE504210
Laura DE504211
Laura DE504212
Cheryl ED503360

I want this to be arranged in rows, one for each of the values in Column A, like so:

Mary CS208515 CS208518 CS308520
Susan HE501924
Lisa DE504210
Laura DE504211 DE504212
Cheryl ED503360

etc, etc

Some of the unique numbers in column A appear once, twice, 12, or many more times.

I've found a VBA script that will almost do it:


Sub lineemup()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 1 Step -1
If Cells(i, 1) = Cells(i + 1, 1) Then
nc = Cells(i, Columns.Count).End(xlToLeft).Column + 1
Cells(i + 1, 2).Resize(, nc).Copy Cells(i, nc)
Rows(i + 1).Delete
End If
Next i
End Sub

This transposes the data, but it all truncates at column E, even if there are - for instance - 12 entries.... and I can't figure out why.

Can anyone help?