excel – VBA – How to sort values in listbox in ascending order?
Try, please replacing of
If .List(i) > .List(j) Then
If CLng(.List(i)) > CLng(.List(j)) Then
Temp = CLng(.List(j))
In this way, the comparison it is done between numbers, not between strings.
But if you have also strings in the list box, the code will return an error…