+ Reply to Thread
Results 1 to 8 of 8

Custom sort is not working

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Custom sort is not working

    Hi friends,
    I want to custom sort the data in column K on Member sheet as follows:
    President
    IPP
    Vice President
    Treasurer
    JT. Treasurer
    Hon. Gen. Secretary
    JT. Secretary
    Ec Member

    But the data is not sorting as per custom list.

    Any help will be highly appreciated.

    Thanking you.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: Custom sort is not working

    Works for me:

    Please Login or Register  to view this content.

    The first (alphabetical) sort is just to check that the custom list works

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    08-04-2014
    Location
    Riga
    MS-Off Ver
    2010
    Posts
    579

    Re: Custom sort is not working

    Works fine to me

  4. #4
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Custom sort is not working

    Hello TMS,

    Thank you. It's working fine.

    However, I didn't understand what was wrong in my code. Will you please point out my mistake to avoide it in future?

    Thank you and have a nice day.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: Custom sort is not working

    You're welcome. Thanks for the rep.


    If I'm honest, I didn't test your code. I just extracted the code to create a Custom List, put that into a subroutine on its own and ran it. That created the Custom List. I then recorded a macro to first sort the data alphabetically, as a base line, and then sorted the data using the Custom List.

    Regards, TMS

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: Custom sort is not working

    The sort works fine. The problem is that it doesn't always get there. This code fails:

    Please Login or Register  to view this content.
    when the data has previously been copied. If the sheet (data area) is blank, the code works.

    You might as well always just clear the data area every time, I think. But anyway, try this:

    Please Login or Register  to view this content.

    Regards, TMS

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Custom sort is not working

    Hello TMS,

    Warm greetings from me!

    Excellent! Excellent! Excellent!

    Actually I was also facing this problem. I have to run the code twice each time. First time I have to click on end to exit from the sub and second time I get the perfect output.

    I by heart thank you for this latest amended code to achieve the target in a single attempt without error. I appreciate you for the same especially when I marked the thread solved. It shows your concern about the problem and sincere hard efforts to solve the problem.

    Finally, once again I appreciate and thank you for the same.

    Have a nice day!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,507

    Re: Custom sort is not working

    You're welcome. Thanks for the rep, again.

+ 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. [SOLVED] Excel has stopped working... after custom sort
    By jhren in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2014, 04:46 AM
  2. Challenged: ascending sort within custom sort
    By jhren in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2013, 12:35 PM
  3. [SOLVED] Custom Sort not working
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 06-20-2013, 02:11 AM
  4. [SOLVED] Record Macro for Custom Sort not Working as I need...
    By LeoThe Lion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 07:52 AM
  5. Custom Sort with text fields not working
    By SEMMatt in forum Excel General
    Replies: 1
    Last Post: 12-23-2011, 10:06 AM
  6. Excel 2007 : custom sort in pivot table not working
    By bigh2odog in forum Excel General
    Replies: 0
    Last Post: 10-02-2009, 10:45 AM
  7. [SOLVED] Excel sort by Fill Color by custom list sort
    By Dash4Cash in forum Excel General
    Replies: 2
    Last Post: 07-29-2005, 06:05 PM

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