Try this:
Option Explicit
Sub x()
Dim wks As Worksheet
Dim r As Range
Dim iRow As Long
Dim iOfs As Long
Set wks = Worksheets("Sheet1")
With wks
.UsedRange.Sort Key1:=.UsedRange(1), Order1:=xlAscending
Set r = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
iRow = 2
Do While iRow <= r.Rows.Count + r.Row - 1
iOfs = 1
With r(iRow, 1)
Do While .Offset(iOfs).Value = .Value
.Offset(iOfs, 1).Copy Destination:=.Offset(, iOfs + 1)
.Offset(iOfs).Resize(, 2).ClearContents
iOfs = iOfs + 1
Loop
End With
iRow = iRow + iOfs
Loop
.UsedRange.Sort Key1:=.UsedRange(1), Order1:=xlAscending
End With
End Sub
Bookmarks