beim Start dieses Makros taucht ein Fehler auf:
"Variable nicht definiert."
Markiert wir dann im Debugger: DataOption1:=xlSortTextAsNumbers
Wer kann mir bitte weiterhelfen?
------------------------------------------------------
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
Dank Euch,
Servus,
Anton