+ Reply to Thread
Results 1 to 6 of 6

Sorting individual Cells

  1. #1
    Registered User
    Join Date
    01-17-2007
    Posts
    3

    Sorting individual Cells

    Hi,

    I have cells containing 2 or more words and would like to sort these words in each cell alphabetically

    eg. cell contains:

    mouse dog cat

    change to:

    cat dog mouse

    thanks guys

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    This code might help. See the link below and look under VBA - For Beginners if your not sure how to add the code


    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    01-17-2007
    Posts
    3
    Thats great!

    However is there any way i can use it when selecting a group of cells.

    It works on individual cells but when i try and run it for a group it returns 'type mismatch error'

    thanks

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try this. It assumes data to sort starts in A10. Change as required

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Registered User
    Join Date
    01-17-2007
    Posts
    3
    YES!

    That works. Thanks a lot for your help man. Really appreciate it!

    cheers

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    I'm sure the code to call the SortInOneCell could be more dynamic but still learning myself so I'm using you as a guinea pig

    VBA Noob

+ 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