View Single Post
 
Old 01-27-2022, 01:04 PM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2019
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Would a user-defined function be OK?
2022-01-27_204200.png


Code:
Function CellSort(cll)
x = Split(cll, ",")
For i = LBound(x) To UBound(x) - 1
  For j = LBound(x) To UBound(x) - 1 - i
    If CDec(x(j)) > CDec(x(j + 1)) Then temp = x(j): x(j) = x(j + 1): x(j + 1) = temp
  Next j
Next i
CellSort = Join(x, ",")
End Function
Reply With Quote