Ich habe im Netz folgende genialen VBA Code gefunden und beiße mir die Zähne aus
den anzupassen!
Die Limitierung wünschte ich mir weg, aber wie das gehen soll frag ich mich?
Wenn ich Tabellen mit 16 Spalten und 40000 Zeilen sortieren möchte dann steigt er hier lastRow = Cells(1, 1).End(xlDown).Row einfach aus = Überlauf
Bis ca. 32250 Zeilen ist alles iO danach kommt der Überlauf.
Ich bedanke mich schon mal für den entgegengebrachten Support!
Option Explicit
sorts cells in all rows of current worksheet ascending from left to right
Sub horizontalSort()
Dim i, lastRow As Integer
Const firstColumn As Integer = 1
Const lastColumn As Integer = 10
find last row
lastRow = Cells(1, 1).End(xlDown).Row
sort cells in each row ascending from left to right
For i = 1 To lastRow
Range(Cells(i, firstColumn), Cells(i, lastColumn)).Select
Selection.Sort Key1:=Range("A" & i), _
Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, _
Orientation:=xlLeftToRight, _
DataOption1:=xlSortTextAsNumbers
Next i
End Sub