Ich möchte ein Tabellenblatt spaltenweise sortieren.
Es sollen jeweils 2 Spalten sortiert werden, also Spalte A und Spalte B, dann Spalte C und D usw.
Dies soll bis Spalte DO & DP (119 / 120) durchlaufen.
Diesen Code möchte in eine Schleife packen, um nicht den nachfolgenden Code für jedes Spaltenpaar zu schreiben.
Private Sub Sortieren1()
Dim I As Integer
I = Worksheets("Urlaub").Cells(65536, 1).End(xlUp).Row
Range(Cells(3, 1), Cells(I, 2)).Sort Key1:=Cells(3, 1), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
Private Sub Sortieren2()
Dim I As Integer
I = Worksheets("Urlaub").Cells(65536, 3).End(xlUp).Row
Range(Cells(3, 3), Cells(I, 4)).Sort Key1:=Cells(3, 3), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
usw.
Hat jemand eine Lösung.
Vielen Dank im Voraus.
Gruß Volker