I want to sort an array of values declared as double in descending order.
The commands array.Sort
and array.Reverse
don't work.
Please note that I want to sort the array with an embedded VBA function and not by a sorting algorithm written by myself.
Sub sortiereMesswerte()
Dim werte(15) As Double
Dim i As Integer
Sheets("Eingabe").Select
'initliaze array
For i = 0 To 15
werte(i) = Cells(i + 2, 2)
Next i
'Sort Array
werte.Sort
werte.Reverse
Sheets("Ausgabe").Select
'print array
For i = 0 To 15
Cells(i + 2, 2) = werte(i)
Next i
End Sub