+ Reply to Thread
Results 1 to 8 of 8

Sorting multiple columns issue

  1. #1
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Sorting multiple columns issue

    Hello forum,

    I have ran into an issue that seems very simple but...

    Trying to record a macro to Sort multiple columns (A-N) based on column D ($PH)

    Im doing everything correctly, highlight entire range and sort column D values A-Z... But the results are giving me the smallest $PH first, i need the largest to smallest.

    Anyone know what im doing wrong?

    I ran into this problem on a previous workbook and a great forum member helped write VBA, but i have no idea how to apply to new workbook as columns are different and a cpl different actions are taken. i Remember what we had to do tho was have VBA sort by hours, then sort $PH down to first empty cell.... im thinking their has to ne an easier way tho

    Any help/advice is greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Sorting multiple columns issue

    I don't know where your data is coming from but column D data has leading and trailing spaces. Even the "empty" cells have two space characters.
    Ben Van Johnson

  3. #3
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Re: Sorting multiple columns issue

    column D is from formula =(IFERROR(Data!CL2/'Daily Report'!BB18,""))

    I tried adding =TRIM ti formula =TRIM(IFERROR(Data!CL2/'Daily Report'!BB18,""))

    But is still giving my lowest $PH first

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sorting multiple columns issue

    Try this...
    =IFERROR(LARGE($C$3:$C$24,ROW(A1)),"")
    You can then use INDEX/MATCH to pull in the rest of the data
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953

    Re: Sorting multiple columns issue

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Re: Sorting multiple columns issue

    Got it!!! TY so much guys!

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Sorting multiple columns issue

    happy to help, thanks for the feedback

  8. #8
    Forum Contributor keith740's Avatar
    Join Date
    04-24-2015
    Location
    Racine, Ohio
    MS-Off Ver
    MS365
    Posts
    241

    Re: Sorting multiple columns issue

    =IFERROR(LARGE($C$3:$C$24,ROW(A1)),"")

    thought for sure this would work, but if agent has 0 $PH, Index/Match is pulling lots of duplicate rows

+ 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 Multiple Columns
    By BT3 in forum Excel General
    Replies: 11
    Last Post: 03-22-2016, 11:10 PM
  2. Replies: 1
    Last Post: 12-08-2014, 09:55 AM
  3. Replies: 13
    Last Post: 12-19-2013, 11:06 PM
  4. Sorting Multiple Columns
    By obrien979 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-21-2013, 07:45 PM
  5. sorting through multiple columns vba
    By tinzpro in forum Excel General
    Replies: 1
    Last Post: 07-23-2012, 08:07 PM
  6. Sorting Multiple Columns Issue
    By gibsoneagle05 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-26-2008, 12:11 AM
  7. Sorting multiple columns in VBA
    By Mahi in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-13-2005, 03:06 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