ich habe mit mir folgendes Makro aufgezeichnet, allerdings funktioniert es nicht so wie gewünscht!
ActiveWorkbook.Worksheets("Tabelle1").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Tabelle1").AutoFilter.Sort.SortFields.Add Key:= _
Range("B1:B" & letztezeile), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Tabelle1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveWorkbook.Worksheets("Tabelle1").Range("A1").AutoFilter Field:=1, Criteria1:= _
">=" & CLng(CDate(Format(Date, "dd.mm.yyyy")))
ActiveWorkbook.Worksheets("Tabelle1").AutoFilter.Sort.SortFields.Add Key:= _
Range("A1:A" & letztezeile), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Tabelle1").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Und zwar soll er mir das Datum auf heute + Zukunft begrenzen und natürlich aufsteigen sortieren und in Spalte B soll er mir das ebenfalls aufsteigend sortieren.
Beispiel:
01.01.2017 AA
01.01.2017 BB
02.01.2017 AA
02.01.2017 BB
Bin für jede Hilfe dankbar.
Thomas