Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default How to sort ascending or descending in multiple entries within one single cell?

Hi folks,

Am using Excel 2003... in my cell A1, i typed the following using Alt
+Enter

Orange
Apple
Pear
Banana

How can I sort them (they all inside 1 single cell)?

Thanks a lot.

cheers:)

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,819
Default How to sort ascending or descending in multiple entries withinone single cell?

Cut and Paste.

wrote:

Hi folks,

Am using Excel 2003... in my cell A1, i typed the following using Alt
+Enter

Orange
Apple
Pear
Banana

How can I sort them (they all inside 1 single cell)?

Thanks a lot.

cheers:)


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How to sort ascending or descending in multiple entries within one single cell?

Found this routine in one of these news groups. Neglected to attribute at the
time to originator.

Sub SortCell()

'Sorting cell contents
'You can use the split command to convert the content to an array, then sort
'the array, use the join command to recreate, then place it back in the cell.

Dim i As Long, J As Long
Dim swap1, swap2
Dim varr
varr = Split(ActiveCell, Chr(10)) 'change delimiter if necessary
' 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, " "))
End Sub


Gord Dibben MS Excel MVP

On Tue, 21 Aug 2007 09:02:30 -0700, "
wrote:

Hi folks,

Am using Excel 2003... in my cell A1, i typed the following using Alt
+Enter

Orange
Apple
Pear
Banana

How can I sort them (they all inside 1 single cell)?

Thanks a lot.

cheers:)


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default How to sort ascending or descending in multiple entries within one

Hi,

You can only sort cells but nor cells that have paragraph mark within a cell.

Challa Prabhu

" wrote:

Hi folks,

Am using Excel 2003... in my cell A1, i typed the following using Alt
+Enter

Orange
Apple
Pear
Banana

How can I sort them (they all inside 1 single cell)?

Thanks a lot.

cheers:)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ascending Sort formula, change to neg #: descending sort.. nastech Excel Discussion (Misc queries) 6 July 2nd 07 11:00 PM
How to sort out (ascending or descending) automatically a list PF Excel Worksheet Functions 1 December 13th 06 03:27 PM
Excel worksheets needs to sort ascending or descending order. Md. Mahfuzul Mannan Excel Worksheet Functions 1 September 3rd 06 05:04 PM
Sort other than by alphabetical ascending/ descending Melissa Excel Discussion (Misc queries) 6 September 2nd 05 07:25 AM
how can I hide sort ascending and sort descending options in the . vida Excel Discussion (Misc queries) 0 December 11th 04 12:31 AM


All times are GMT +1. The time now is 11:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"