I would like to sort a range in absolute value but keep the sign of the number.
I did a code that works fine, but I copy/paste values in another range and afterwards, I delete it.
I would like not to copy/paste in my sheet but just do it in memory.
How can I do that?
My range:
-1
2
3
-4
4.5
The expected result :
4.5
-4
3
2
-1
My code:
Sub Appel()
For i = 1 To Range("D1").End(xlDown).Row
Range("E" & i) = Abs(Range("D" & i).Value)
Next i
Range("E1", Range("D1").End(xlDown)).Sort Key1:=Range("E1"),
Order1:=xlDescending, Header:=xlNo
Columns("E:E").Delete
End Sub