+ Reply to Thread
Results 1 to 4 of 4

Sorting within a single cell in Excel

  1. #1
    Registered User
    Join Date
    02-03-2011
    Location
    Washington, USA
    MS-Off Ver
    Excel 2010
    Posts
    1

    Sorting within a single cell in Excel

    Hello all,

    I was wondering how difficult it would be to sort comma delimited values within a single cell in Excel 2010. Say I've got a single cell containing this:

    BA102, BA15, BA25, BA17, BA27

    What I'm looking for is a macro or function that would change the cell contents to this:

    BA15, BA17, BA25, BA27, BA102

    I realize that it could easily be done in someones head while they're looking at it, but the cells I'm working with are filled with hundreds of these little values and the spreadsheets are created by another company and given to us all out of order like in that first line of values up there.

    3 cheers to my boss for handing this task off to an accountant. We don't have an in-house programmer I can implement a macro, I just don't know how to write them, heh. Is there any way to do this in a relatively easy way?

    Thanks for any help anyone can give me, I appreciate it. If more info is needed I'll be happy to provide it.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Sorting within a single cell in Excel

    JARF,


    Welcome to the Excel Forum.


    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Sorting within a single cell in Excel

    Please Login or Register  to view this content.
    Last edited by nimrod; 02-03-2011 at 07:14 PM.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Sorting within a single cell in Excel

    But you can also use this function.
    Put it in a macromodule.
    In de data tot be sorted reside in cell A1, put e.g. in cell B1: =sort_snb(A1)

    Please Login or Register  to view this content.
    @Nimrod

    To populate an array:
    Instead of
    Please Login or Register  to view this content.
    you can use
    Please Login or Register  to view this content.
    Last edited by snb; 02-03-2011 at 07:39 PM.



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1