Ahh, tie, good example.
![]()
Sub Sort_Time() Dim a, i As Long, ii As Long, w With Range("b6").CurrentRegion a = .Value With CreateObject("System.Collections.SortedList") For i = 2 To UBound(a, 1) If a(i, 11) <> "" Then ReDim w(1 To UBound(a, 2)) For ii = 1 To UBound(a, 2) w(ii) = a(i, ii) Next .Item(a(i, 11) * 1000 + i / 100000) = w End If Next For i = 0 To .Count - 1 For ii = 1 To UBound(a, 2) a(i * 2 + 2, ii) = .GetByIndex(i)(ii) Next Next End With .Value = a End With End Sub
Bookmarks