Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I sort multiple names within one cell?
How do I sort multiple names, all within a single cell, with all names
sharing a single task listed in an adjacent cell? Thank you! |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I sort multiple names within one cell?
a bit, as in a LOT, more detail would be helpful.
-- Don Guillett SalesAid Software "Deborah P. in Charlotte" <Deborah P. in wrote in message ... How do I sort multiple names, all within a single cell, with all names sharing a single task listed in an adjacent cell? Thank you! |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How do I sort multiple names within one cell?
Deborah
Are the names delimited by comma? If so use the macro as is. If separated by a space, make adjustments at marked points. Sub SortCell() Dim i As Long, j As Long Dim swap1, swap2 Dim varr varr = Split(ActiveCell, ",") ' varr = Split(Activecell, " ") if space delimited ' peform bubble sort For i = 0 To UBound(varr) - 1 For j = i + 1 To UBound(varr) varr(i) = Trim(varr(i)) varr(j) = Trim(varr(j)) If varr(i) varr(j) Then swap1 = varr(i) swap2 = varr(j) varr(j) = swap1 varr(i) = swap2 End If Next j Next i ActiveCell.Value = Application.Trim( _ Join(varr, ", ")) 'remove the comma from between the ", " End Sub Gord Dibben MS Excel MVP On Tue, 10 Oct 2006 10:16:03 -0700, Deborah P. in Charlotte <Deborah P. in wrote: How do I sort multiple names, all within a single cell, with all names sharing a single task listed in an adjacent cell? Thank you! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with this conditional IF statement | Excel Discussion (Misc queries) | |||
How can I sort multiple times | Excel Worksheet Functions | |||
How do I split a cell into multiple rows/columns? | Excel Discussion (Misc queries) | |||
Excel Sort function should not sort the cell formatting! | Excel Worksheet Functions | |||
GET.CELL | Excel Worksheet Functions |