Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 01-27-2022, 01:04 PM
p45cal's Avatar
p45cal p45cal is offline How to sort numbers within a cell Windows 10 How to sort numbers within a cell Office 2019
Expert
 
Join Date: Apr 2014
Posts: 962
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
 

Tags
excel 2010, sort



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort/select by duplicates containing cell colour JamesTheNoob Excel 3 04-08-2019 09:11 AM
Sort numbers in Ascending order btserver Excel 5 03-16-2019 07:54 AM
How to sort numbers within a cell Cell references don't change on sort gebobs Excel 3 07-23-2015 05:14 AM
Search a cell that contains words and numbers and convert the numbers to metric Carchee Excel Programming 36 10-08-2014 03:16 PM
Trying to autofilter 8-10 rows of numbers to sort in a group Jack-P-Winner Excel 0 11-25-2013 10:55 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:45 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft