+ Reply to Thread
Results 1 to 32 of 32

Auto sort values from highest to lowest based off of value

Hybrid View

qj67 Auto sort values from highest... 07-07-2008, 07:10 PM
Tnesper Select each block of cells... 07-07-2008, 07:32 PM
qj67 Thank you for the response... 07-07-2008, 07:37 PM
qj67 I hope I explained my issue... 07-08-2008, 12:55 PM
modytrane Sort in ascending Order 07-08-2008, 01:28 PM
Hamadah Re: Auto sort values from... 05-16-2010, 07:45 AM
modytrane Re: Auto sort values from... 05-19-2010, 08:15 AM
Hamadah Re: Auto sort values from... 05-22-2010, 06:44 AM
modytrane Re: Auto sort values from... 05-23-2010, 11:38 AM
Hamadah Re: Auto sort values from... 05-23-2010, 11:41 PM
AliciaDawn Re: Auto sort values from... 06-24-2014, 10:24 AM
mherboldsheimer Re: Auto sort values from... 02-07-2011, 10:59 AM
mherboldsheimer Re: Auto sort values from... 02-07-2011, 11:00 AM
  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Portland, Or.
    Posts
    13

    Auto sort values from highest to lowest based off of value

    I need the close% column to auto sort from highest to lowest so that I can see at a glance who the top sales person is. I have conditional formatting for the top three but I would rather them auto sort by close%, can anybody help me with this. I have attached the file, thanks for your help!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-17-2008
    Posts
    50
    Select each block of cells one at time..

    So for the first one, highlight cells A6:D17. Under the home ----> editing section, select sort and filter ----> custom sort. For sort by selection close% and then change order to largest to smallest. You will have to do that same thing for each block of cells, but that should do it.

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    Portland, Or.
    Posts
    13
    Thank you for the response but that's not exactly what I need done. I need it to auto sort whenever the values are changed so that I don't have to do it manually each time I put in numbers.

  4. #4
    Registered User
    Join Date
    07-02-2008
    Location
    Portland, Or.
    Posts
    13
    I hope I explained my issue well enough, does anybody know how to do this?
    Last edited by qj67; 07-08-2008 at 01:03 PM.

  5. #5
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Sort in ascending Order

    See the attached example.
    On Sheet1, the marked column of data gets sorted in ascending order every time you add another value in that range or delete or change a value.
    Hope it helps.
    Expand the range as you need in the Macro.
    modytrane
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Sort In Ascending Order

    Here's your file.
    I had to create column A with copies of pct and sort all five column.
    If you change any value for any sales rep.i Nashua, that block will automatically sort.
    Hope it helps.
    modytrane.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    05-15-2010
    Location
    Oman
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Auto sort values from highest to lowest based off of value

    any one can help me on that please?

  8. #8
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Auto sort values from highest to lowest based off of value

    Here's the Macro used in the example posted before.

    Private Sub Worksheet_Change(ByVal Target As Range)
     Range("B6:E17").Select
        Selection.Sort Key1:=Range("E6"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            Range("H6:K17").Select
        Selection.Sort Key1:=Range("K6"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            
        Range("B21:E32").Select
        Selection.Sort Key1:=Range("E21"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            Range("H21:K32").Select
        Selection.Sort Key1:=Range("K21"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
                  
            Range("C2").Select
    End Sub

    Paste this in to your Worksheet_Change _Event.

    Hamadah,
    I don't know your application.
    If you can't make it work, post a sample of your worksheet.

    modytrane

  9. #9
    Registered User
    Join Date
    05-15-2010
    Location
    Oman
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Auto sort values from highest to lowest based off of value

    Quote Originally Posted by modytrane View Post
    Here's the Macro used in the example posted before.

    Private Sub Worksheet_Change(ByVal Target As Range)
     Range("B6:E17").Select
        Selection.Sort Key1:=Range("E6"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            Range("H6:K17").Select
        Selection.Sort Key1:=Range("K6"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            
        Range("B21:E32").Select
        Selection.Sort Key1:=Range("E21"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
            Range("H21:K32").Select
        Selection.Sort Key1:=Range("K21"), Order1:=xlDescending, Header:=xlNo, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
                  
            Range("C2").Select
    End Sub

    Paste this in to your Worksheet_Change _Event.

    Hamadah,
    I don't know your application.
    If you can't make it work, post a sample of your worksheet.

    modytrane

    modytrane,
    thank you for helping me, i tried to make it work but i couldn't as my values are getting the data from two tables and when i use the code everything mixed up. have a look in attached file.
    what i try to sort is the NPT % - first NPT table i couldn't make it happened as values connected to formulas but when i made a copy just below it taking formulas out the code had worke. so what i need to sort is the first table as i need the data sorted Automaticly when ever there is a change on related data.
    Attached Files Attached Files
    Last edited by Hamadah; 05-22-2010 at 06:59 AM.

  10. #10
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Auto sort values from highest to lowest based off of value

    try the attached file and let me know if this works for you.


    If you change anything on any of the three sheets, it will sort the NPT % table on "Contractors" sheet.

    modytrane
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    05-15-2010
    Location
    Oman
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Auto sort values from highest to lowest based off of value

    Quote Originally Posted by modytrane View Post
    try the attached file and let me know if this works for you.


    If you change anything on any of the three sheets, it will sort the NPT % table on "Contractors" sheet.

    modytrane
    modytrane
    Yes it is working very fine.Thank you thank you thank you so much. you are genius. i spent more than three weeks on it but i couldn't do it. I am realy appreciated. thank you again.

    best regards,
    hamadah

  12. #12
    Registered User
    Join Date
    05-15-2010
    Location
    Oman
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Auto sort values from highest to lowest based off of value

    modytrane

    Unfortunately it didn't work with the "Data worksheet". When i tested on "Contractors worksheet" it was working fine but all the data source came from "Data Worksheet".please have a look in attached file i added the last row with yellow colour but it didn't work. at the same time the NPT average column on "Contractors" worksheet lost one of the green colour.

    It is work when i go to the "Contractors worksheet" and click on an empty cell then press Delete Function at the keyboard then we will be able to see it working. So if i protect the "Contractors worksheet" by password, it will be also looks like manual sorting because i have to unprotect the "Contractors worksheet" first then double click on an empty cell or press Delete keyboar function so i can see the effect of changes.
    Attached Files Attached Files
    Last edited by Hamadah; 05-24-2010 at 02:58 AM.

  13. #13
    Registered User
    Join Date
    06-24-2014
    Location
    Laurel,MD
    MS-Off Ver
    2010
    Posts
    1

    Re: Auto sort values from highest to lowest based off of value

    Hi
    I copied your macro and pasted into my sheet but i could not get it to work
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    10-14-2010
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Auto sort values from highest to lowest based off of value

    I used this code for an automatic sort, but the sort only work if I manually go into the cells that changed and hit enter. Is there anything I can add to the code to make it sort without doing this manually? The data being sorted in range B54 comes from another sheet and goes into the sorted area via formulas.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Range("A54:E63").Select
    Selection.Sort Key1:=Range("B54"), Order1:=xlDescending, Header:=xlNo, _
    OrderCustom:=6, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    Application.Calculation = xlCalculationAutomatic

    End Sub

    Thanks for any help!

  15. #15
    Registered User
    Join Date
    10-14-2010
    Location
    Baltimore, MD
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Re: Auto sort values from highest to lowest based off of value

    I used this code for an automatic sort, but the sort only work if I manually go into the cells that changed and hit enter. Is there anything I can add to the code to make it sort without doing this manually? The data being sorted in range B54 comes from another sheet and goes into the sorted area via formulas.

    Private Sub Worksheet_Change(ByVal Target As Range)
    Range("A54:E63").Select
    Selection.Sort Key1:=Range("B54"), Order1:=xlDescending, Header:=xlNo, _
    OrderCustom:=6, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    Application.Calculation = xlCalculationAutomatic

    End Sub

    Thanks for any help!

+ 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