Sub
TestIt()
TestSort2000 ThisWorkbook.Name,
"Tabelle2"
End
Sub
Private
Sub
TestSort2007(WbName
As
String
, ShName
As
String
)
Dim
Rng
As
Range
With
Workbooks(WbName).Sheets(ShName)
If
.AutoFilterMode
Then
.Cells.AutoFilter
letztespalte = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 2, 2,
False
).Column
letztezeile = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 1, 2,
False
).Row
Set
Rng = .Range(.Cells(2, letztespalte - 1), .Cells(letztezeile, letztespalte))
With
.Sort
With
.SortFields
.Clear
.Add Key:=Range(Rng.Columns(2).Address) _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
End
With
.SetRange Range(Rng.Address)
.Header = xlGuess
.MatchCase =
False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End
With
End
With
End
Sub
Private
Sub
TestSort2000(WbName
As
String
, ShName
As
String
)
Dim
Rng
As
Range
With
Workbooks(WbName).Sheets(ShName)
If
.AutoFilterMode
Then
.Cells.AutoFilter
letztespalte = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 2, 2,
False
).Column
letztezeile = .Cells.Find(
"*"
, .Cells(1), -4123, 2, 1, 2,
False
).Row
Set
Rng = .Range(.Cells(2, letztespalte - 1), .Cells(letztezeile, letztespalte))
Rng.Sort Key1:=Range(Rng.Columns(2).Cells(1).Address), Order1:=xlDescending, Header:=xlGuess, MatchCase:=
False
, Orientation:=xlTopToBottom
End
With
End
Sub