ich möchte gerne eine Zeile nach Auswahl dsortieren lassen.
Sub horizontalSort()
Dim lCol As Long
Dim lRe As Long
Dim sFind As String
Dim lAnfangSpalte As Long
Dim wks As Worksheet
Set wks = Sheets("Sort")
With wks
sFind = Cells(1, 8)
lRe = .Columns(1).Find(what:=sFind, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:= _
xlByRows).Row
If .Cells(lRe, 2) = "*Neu*" Then
lAnfangSpalte = 3
Else
lAnfangSpalte = 2
End If
lCol = .Cells(lRe, .Columns.Count).End(xlToLeft).Column
Range(.Cells(lRe, lAnfangSpalte), .Cells(lRe, lCol)).Sort Key1:=.Cells(lRe, _
lAnfangSpalte), _
Order1:=xlAscending, Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
End With
' Stop
End Sub
Leider rührt sich garnichts.
Danke, Gruß Olga
https://www.herber.de/bbs/user/110543.xlsm