Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following user defined function set up in a workbook and it works
fine but I would like to take it one step further. Option Explicit Function SortText(myStr As String) As String Dim mySplit As Variant Dim iCtr As Long Dim jCtr As Long Dim Temp As Variant mySplit = Split(myStr, " ") For iCtr = LBound(mySplit) To UBound(mySplit) - 1 For jCtr = iCtr + 1 To UBound(mySplit) If mySplit(iCtr) mySplit(jCtr) Then Temp = mySplit(iCtr) mySplit(iCtr) = mySplit(jCtr) mySplit(jCtr) = Temp End If Next jCtr Next iCtr SortText = Join(mySplit, " ") End Function I would like to have some code that would sort the data in the cells (column E) without having to add a new column to either place the sorted data or to hold the sorted data. The data in coulmn E looks like this: AAI BII TTU QQS AAC NUY GGE BBT I need those 3 digit (sometimes 4 digit codes) sorted in alpha order. The number of rows is never the same. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sort Problem | Excel Discussion (Misc queries) | |||
sort problem | Excel Programming | |||
Sort Problem | Excel Programming | |||
Sort Problem | Excel Programming | |||
find largest data (part2) hard work.. | Excel Programming |