+ Reply to Thread
Results 1 to 2 of 2

2 level sorting

  1. #1
    Registered User
    Join Date
    07-14-2009
    Location
    London,England
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    17

    2 level sorting

    Good morning everyone

    I hope someone can help me with this. I am trying to filter my worksheet at 2 distinct levels. Firstly, I am trying to sort the workbook in ascending results in terms of column B. I managed to do this by recording the macro and got the following code:

    Selection.AutoFilter
    Range("A1:AE144").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:= _
    xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal

    However, once the workbook is sorted like this, I would like to further sort the results in ascending values in terms of Column J. Thus keeping the data sorted in terms of Column B... but further sorted in terms of Column J.


    Please can someone help me with this. I would really be grateful. I have attached a worksheet that shows an example of what I am looking to do:
    Rows 1-13: Original workbook layout
    Rows 20-33: Data sorted in terms of Column B in ascending order
    Rows 40-53: Data sorted in terms of Column J in ascending order

    Really would appreciate the help

    Regards

    Paul
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-14-2009
    Location
    London,England
    MS-Off Ver
    Excel 2003 and Excel 2007
    Posts
    17

    Re: 2 level sorting

    Never mind, managed to achieve desired result by doing the following:

    Cells.Select
    Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("O2") _
    , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
    False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
    :=xlSortNormal

    Thank you though for looking to help

    Regards

+ 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