copy and paste this in a module and run the macro
Sub Sorteren()
Dim a, r%, k%, Dict As Object, b, splits, c As Range
Set c = Sheets("sheet1").Range("A7:F100")
a = c.Value
Set Dict = CreateObject("system.collections.arraylist")
With Dict
For r = 1 To UBound(a)
For k = 1 To UBound(a, 2) Step 2
If Not (IsEmpty(a(r, k))) Then .Add Left(a(r, k) & Space(50), 50) & Chr(2) & a(r, k + 1)
Next
Next
.Sort
a = .toarray
End With
ReDim b(1 To 1 + Int(UBound(a) / 3), 1 To 6)
For r = 0 To UBound(a)
splits = Split(a(r), Chr(2))
b(1 + Int(r / 3), 1 + 2 * (r Mod 3)) = Trim(splits(0))
b(1 + Int(r / 3), 2 + 2 * (r Mod 3)) = CDbl(splits(1))
Next
With c
.ClearContents
.Resize(UBound(b), UBound(b, 2)).Value = b
End With
End Sub
Bookmarks