10000 rows of data and 15 levels. In your example you have duplicate number but can you have duplicate level as well?
Par example you have
342 18
342 21
342 50
could you have say another 342 18 in your data and if so how should that be sorted?
Perhaps 342 18 18 21 50 ? Or should duplicate lines (number and level) be deleted? Finally should the level value be sorted as well? If so Left to Right or Right to Left?
I've written a macro that works for your small example but that doesn't prove it could handle 10 000 rows of data. You could test it on a sample of some hundred lines and se how it "behaves". This macro assumes that your data starts in A1 and except for column A and B the columns C to T must be empty. There is no level sorting done at the moment in this macro.
Perhaps you could upload a workbook with about 1000 rows of data so I have a better chance to see how this code works with more data.
Alf
Bookmarks