+ Reply to Thread
Results 1 to 9 of 9

Sorting Code A to Z Order

  1. #1
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Sorting Code A to Z Order

    Hello,

    On the Vehicle Interval Service sheet there is code to sort the table by the mile interval services 5K, 30K, 100K, and 150K Services by clicking on the orange shape. Which it does well but is there a way to also sort the services within those to A to Z order?

    I also noticed that "Other Service 10" comes before "Other Service 2". Isn't 10 higher than 2 or does Excel treat digits differently?

    Thank you very much for your help

  2. #2
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Sorting Code A to Z Order

    Hello,

    Its sorted alphabetically, that's why 1 comes in front of 2 and then 3 until 9 then excel looks at the number behind 1 what is 0

    you could make then 01, 02, 03 ...,09 ,10

    then it sorts like you want it to
    Please be as complete as possible in your asking so it may save use all the time to rework the solution because you didn't give all the requirements. If you have a layout in mind please work it out first so we can adapt our solution to it. Thanks.
    If you have been helped, maybe you could click the *

  3. #3
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Sorting Code A to Z Order

    Thanks good tip I appreciate the help. This should do it.

  4. #4
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Sorting Code A to Z Order

    Sort the data list and the macro will take this follow that sorting line by line

  5. #5
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Sorting Code A to Z Order

    Can the code have the added sort data list first to take care of that?

  6. #6
    Valued Forum Contributor
    Join Date
    09-30-2018
    Location
    Vlaams Brabant Belgium
    MS-Off Ver
    365
    Posts
    456

    Re: Sorting Code A to Z Order

    yes it can be added but you might lose the possibility to set services in a particular order outside the alphabet
    you only need to set the list with services 1 time and sort it there the way you want it presented

    if you add a new service later on it might be in a bad place when the macro puts it in alphabetical order

  7. #7
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Sorting Code A to Z Order

    Okay why I ask is to have code that does exactly what the column sort in the table first just like what I do. Then have the rest of the code to run to take care of the groups.

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Sorting Code A to Z Order

    Replace "Macro1" with below
    Please Login or Register  to view this content.

  9. #9
    Banned User!
    Join Date
    06-18-2021
    Location
    Peru
    MS-Off Ver
    2010, Microsoft 365
    Posts
    431

    Re: Sorting Code A to Z Order

    Thank you jindon that works great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sorting Data in Order by Value
    By BobBrown60 in forum Excel General
    Replies: 3
    Last Post: 04-19-2021, 10:26 PM
  2. [SOLVED] Sorting by value order
    By DEEARO in forum Excel General
    Replies: 3
    Last Post: 01-11-2021, 11:26 AM
  3. Sorting the order of sheets by the name
    By Ctech in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-25-2005, 12:45 PM
  4. [SOLVED] Re: Sorting the order of sheets by the name
    By Norman Jones in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2005, 08:50 AM
  5. sorting in order
    By ceemo in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-06-2005, 12:05 PM
  6. sorting data in order
    By ceemo in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 12:05 PM
  7. sorting in order
    By ceemo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-30-2005, 08:20 AM

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