Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Word
Microsoft Word Document Management
Sorting comma strings
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Doug Robbins - Word MVP, post: 13839034"] Use: Dim rngSort As Range Dim rngArray As Variant Dim i As Long, j As Long Dim strSorted As String Set rngSort = Selection.Range rngArray = Split(rngSort, ", ") For i = 0 To UBound(rngArray) - 1 For j = i + 1 To UBound(rngArray) If Val(rngArray(i)) > Val(rngArray(j)) Then temp = rngArray(j) rngArray(j) = rngArray(i) rngArray(i) = temp End If Next j Next i For i = 0 To UBound(rngArray) strSorted = strSorted & Str(rngArray(i)) & "," Next i strSorted = Left(strSorted, Len(strSorted) - 1) rngSort.text = strSorted -- Hope this helps, Doug Robbins - Word MVP Please reply only to the newsgroups unless you wish to obtain my services on a paid professional basis. [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Word
Microsoft Word Document Management
Sorting comma strings
Top