+ Reply to Thread
Results 1 to 16 of 16

Custom sort without custom list

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Custom sort without custom list

    Hello everybody
    I have a sheet named "Data" which contains cutom list on which I need to sort column C in sheets("Report")
    I don't want to use custom list feature ( Application.AddCustomList )


    I need to depend on the custom list in range("B2:B8") in sheets("Data")

    I found UDF function but can't apply it
    This my try but I got an error

    Please Login or Register  to view this content.
    The error is at this line
    Please Login or Register  to view this content.
    Sort method of range failed 1004
    Attached Files Attached Files
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    You must use Sort object not Sort method:
    Please Login or Register  to view this content.
    Sortitems function returns string with leading comma but this does not seem to matter.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Mr. Izandol
    Thank you very very much for this correction
    It works great

    Another point in this thread I need to ask about .. what if I have a nother cutom list in another range and I need to apply it too
    How can I do that?
    See the attachment for second custom list
    Attached Files Attached Files

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    You may add another sort field in same way

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Thanks for reply

    I tried that and everything is ok
    Please Login or Register  to view this content.
    But is there an efficient way to make the function more flexible as I intend to add more than two custom lists ..?
    Last edited by YasserKhalil; 01-12-2016 at 08:36 AM.

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    That is not problem - you must only create new sort list and use with CustomOrder on new sortfield.

  7. #7
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Last point I need add column E but sort it in normal way in ascending order
    It is now OK with column C and D but not ok in column E
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Quote Originally Posted by Izandol View Post
    That is not problem - you must only create new sort list and use with CustomOrder on new sortfield.
    I know but I am searching for a way to merge all in one function
    instead of creating one by one
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    to be only in one
    Please Login or Register  to view this content.
    so as to have just one function for all custom lists

  9. #9
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Custom sort without custom list

    maybe so
    Please Login or Register  to view this content.

  10. #10
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Mr. Nilem
    I really apprciate this great and wonderful help
    It is very very well after I removed this line and the results are ok for column C & D
    Please Login or Register  to view this content.
    After adding this line again
    I got incorrect results ..
    My problem now is with column E only ..but as for custom sort it is ok

  11. #11
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Thanks a lot I solved last point by putting this line
    Please Login or Register  to view this content.
    After these two lines
    Please Login or Register  to view this content.
    Last edited by YasserKhalil; 01-12-2016 at 10:13 AM.

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    I would suggest more general function:
    Please Login or Register  to view this content.
    Last edited by Izandol; 01-12-2016 at 01:00 PM. Reason: Miss object reference

  13. #13
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    Posted two times

  14. #14
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Thank you very much Mr. Izandol
    I got an error at this line
    Please Login or Register  to view this content.
    'Error 438 : Object doesn't support this property or method

  15. #15
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Custom sort without custom list

    Yes - I fix this just now. Please use changed code.

  16. #16
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Custom sort without custom list

    Great & Excellent & Awesome. Thank you very much Mr. Izandol
    I'm very pleased with your sharing in this thread
    Mr. Nilem
    Thanks a lot for great and wonderful help you offered
    Kind Regards

+ 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. Custom Sort List
    By druid98 in forum Excel General
    Replies: 0
    Last Post: 10-10-2011, 07:51 PM
  2. [SOLVED] custom list does not sort
    By Matt Lunn in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2005, 06:05 AM
  3. custom list does not sort
    By Matt Lunn in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  4. [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