+ Reply to Thread
Results 1 to 4 of 4

Sorting - 4 Keys

  1. #1
    Registered User
    Join Date
    04-18-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    49

    Sorting - 4 Keys

    Hi guys,

    I need to sort Column "C" in Descending while Columns "H", "E", and "D" in Ascending Order with a macro. Is there a way around the 3 Key limit?

    Thank you!

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Sorting - 4 Keys

    Any combined sort can be done by sequential one column sorts.

    For example, a triple sort of by Name, then on State and then on City, can be done by

    Sort on City
    then Sort on State
    then Sort on Name

    Doing 4 (or more) one column sorts is equivalent to doing a single quadruple (or more) sort.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sorting - 4 Keys

    If Mike's suggestion seems a little counterintuitive, it is because Excel performs stable sorts: the relative order of records having the same key is unchanged.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    04-18-2013
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Sorting - 4 Keys

    Thanks a lot!

+ 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. Capturing Keys
    By Phil_V in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 10-19-2009, 08:38 AM
  2. Sorting by variable keys
    By jgmiddel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-10-2008, 09:30 AM
  3. How to use Alt keys + symbol keys to invoke a macro?
    By keithb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-19-2005, 05:00 PM
  4. [SOLVED] use of F3 & F9 keys
    By Ankur in forum Excel General
    Replies: 2
    Last Post: 08-10-2005, 10:05 AM
  5. sorting more than 3 keys
    By Brooke in forum Excel General
    Replies: 3
    Last Post: 06-18-2005, 12:05 AM

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