Results 1 to 5 of 5

Thread: [Resolved] Sorting ...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Question [Resolved] Sorting ...

    Hi,

    How can I get the data in an Excel column sorted as:

    Fruit 1
    Fruit 2
    Fruit 3
    Fruit 11
    Fruit 21
    Fruit 31

    Instead of:

    Fruit 1
    Fruit 11
    Fruit 2
    Fruit 21
    Fruit 3
    Fruit 31

    The second version is what Excel produces by default when the Sort button is clicked on the Toolbar.

    Thanks,

    OneSource
    Last edited by OneSource; May 26th, 2003 at 07:16 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    You need to put "Fruit" in one column and the numbers in
    another. Format Fruit as a text column and the number as a
    Numeric column.

    Currently the column is formatted as text so Excel sees even the
    numbers as text. The way you describe the first sorting is correct
    for "Text" formatted column.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Thumbs up RobDog888 ...

    Thanks for your response.

    Separating the values into 2 columns isn't an option because I don't have control over the input. I was able to get the sort to work using VBA code. I had hoped that there would have been an easier solution provided by Excel because I'm pretty sure that many people would want their data sorted this way.

    Thanks again,

    OneSource

  4. #4
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863
    Why don'T you use two hidden columns, in which you can put the text and the number seperatly, then sort, and see nothing of those hidden lines. You might even delete them afterwards, if you don'T like to have the columns named a, d,e,f......!
    You're welcome to rate this post!
    If your problem is solved, please use the Mark thread as resolved button


    Wait, I'm too old to hurry!

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Opus ...

    Thanks for your reply, but ...
    Originally posted by OneSource

    ...Separating the values into 2 columns isn't an option because I don't have control over the input.
    The good news is that
    Originally posted by OneSource

    I was able to get the sort to work using VBA code.
    Thanks again, OneSource

Posting Permissions

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



Click Here to Expand Forum to Full Width