Hi Roger,
I decided to give a hard look at this. I repeated your data in 20000 +rows in one worksheet, it takes about 2 seconds to organise with code given below. Have I overlooked anything?
I am using excel 2000 .
Application.ScreenUpdating = False
l = Range("A65536").End(xlUp).Row
For k = 2...