+ Reply to Thread
Results 1 to 12 of 12

Sort function does not correctly reference the answer from the input box.

  1. #1
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Sort function does not correctly reference the answer from the input box.

    Hello,

    The code below does not reference the answer from the input box. I am unsure how to make the sort "Custom order" to reference the answer given in the input box.

    Any help would be appreciated.

    Thanks!


    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Sort function does not correctly reference the answer from the input box.

    What is being entered via the input box?

  3. #3
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Sort function does not correctly reference the answer from the input box.

    Hi Norie,

    It will be a column title.

    Thanks.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Sort function does not correctly reference the answer from the input box.

    I don't think you can just supply a column name.

    I think it needs to be a list which each item separated by commas.

  5. #5
    Forum Contributor
    Join Date
    03-28-2012
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2010
    Posts
    166

    Re: Sort function does not correctly reference the answer from the input box.

    Use Application.Inputbox, with Type:=8

    Please Login or Register  to view this content.
    TRy setting it up this way.
    Last edited by Cutter; 10-15-2012 at 12:00 PM. Reason: Added code tags

  6. #6
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Sort function does not correctly reference the answer from the input box.

    LeapingLizard I am not understanding your advice, sorry. I am a novice with VBA.

    To clarify, I am attempting to sort data from left-to-right based upon row2 using a dynamic value which is entered by the user through the input box. The issue is linking the answer from the input box to the custom sort.

    I can do this sorting manually but I need to incorporate this into a larger macro which can handle many operations.

    The issue is designating the "Answer" in the sort criteria. I am unsure of the format. See below.

    Please Login or Register  to view this content.
    If for example I use the following, the macro runs with no issues.

    Please Login or Register  to view this content.
    The problem is the turning the format "GGG" into the 'Answer'.

    Thanks!
    Last edited by herbie226; 10-11-2012 at 01:43 PM.

  7. #7
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Sort function does not correctly reference the answer from the input box.

    Bumping Thread!!!

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort function does not correctly reference the answer from the input box.

    Can you provide a sample workbook with data and your sort macro (the one that works and the one you are trying)?

    Please also explain what you are trying to achieve with the CustomOrder
    HTH
    Regards, Jeff

  9. #9
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Sort function does not correctly reference the answer from the input box.

    Hello Jeff,

    Thank you for your assistance.


    This is the code that works.
    Please Login or Register  to view this content.

    This is the code that does not work.
    Please Login or Register  to view this content.
    I want to sort all the columns based upon Row2 using a custom sort of "GGG". I know I can do this manually but this is one part of a much larger macro which I am putting together.
    Attached Files Attached Files
    Last edited by herbie226; 10-13-2012 at 08:11 PM.

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort function does not correctly reference the answer from the input box.

    After several several attempts to find a solution I just could not. I placed a message with the other forum members, but not luck so far.

    Once you see this, if there still is not a hit you can bump again.

  11. #11
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Sort function does not correctly reference the answer from the input box.

    perhaps
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  12. #12
    Registered User
    Join Date
    04-25-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Sort function does not correctly reference the answer from the input box.

    Hello JosephP,

    Thank you for your assistance. Your suggestion works great. I appreciate all the help.

    Herbie226

+ 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