Vielen Dank, ist echt ein richtig cooles Forum.
mfg,
sascha
Sub datumSort()
Dim Count1 As Long
Dim Count2 As Integer
For Count1 = 1 To Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCell).Row
For Count2 = 1 To Len(Cells(Count1, 1).Value)
If Mid(Cells(Count1, 1).Value, Count2, 1) = " " Then
Cells(Count1, 1).Value = Mid(Cells(Count1, 1), Count2 + 1, Len(Cells(Count1, 1).Value)) _
& " " & Mid(Cells(Count1, 1), 1, Count2 - 1)
Count2 = Len(Cells(Count1, 1).Value)
Exit For
End If
Next Count2
Next Count1
Range("A1:B" & Rows.Count).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
For Count1 = 1 To Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCell).Row
For Count2 = 1 To Len(Cells(Count1, 1).Value)
If Mid(Cells(Count1, 1).Value, Count2, 1) = " " Then
Cells(Count1, 1).Value = Mid(Cells(Count1, 1), Count2 + 1, Len(Cells(Count2, 1).Value)) & _
" " & Mid(Cells(Count2, 1), 1, Count2 - 1)
Count2 = Len(Cells(Count1, 1).Value)
Exit For
End If
Next Count2
Next Count1
End Sub
Dieses Modul, wird deine Angaben in Spalte A, richtig sortieren.
Gruss, Robert