Hi
This works with your sample data, assuming it is in the range A1:C6.
However, if your real data is likely to contain a number in column A that doesn't have a match in column B, then it will have to be revised.
Sub aaa()
'sort columns B and C based on column B
Range("B:C").Sort order1:=xlAscending, key1:=Range("B1")
'step through the data in column A, and if the number is > than the number
'in column B, then shift it down.
For i = 1 To Cells(Rows.Count, 2).End(xlUp).Row
If Cells(i, 1) > Cells(i, 2) Then Cells(i, 1).Insert shift:=xlDown
Next i
End Sub
rylo
Bookmarks