+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    07-04-2009
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Sorting multiple rows/columns

    Hi
    I have a very large spreadsheet with a number of columns of random figures. To sort these lowest to highest I have been transposing the sections of rows requiring sorting to columns and sorting each column separately. Then transposing them back again. Is there an easier way of doing this please

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,126

    Re: Sorting multiple rows/columns

    There is an option to sort left to right -- does that do what you want?
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-04-2009
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Sorting multiple rows/columns

    thanks shg, i wish. no not that easy. i have about 3000 rows of about 15 columns. columns 3 to 9 have data i need to sort lowest to highest and doing them individually is taking forever. can't find a way to do multiple sorts

  4. #4
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,126

    Re: Sorting multiple rows/columns

    Post an example and explain what you need?
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    07-04-2009
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Sorting multiple rows/columns

    here is a very basic idea of what im working on. i need to sort lowest to highest column c(44) to column i (38). i have nearly 4 thous rows to sort any help would be very welcome.

    PKL 1/05/2009 44 43 34 4 18 10 38
    LTI 2/05/2009 34 43 7 4 39 13 9
    FTR 2/05/2009 22 35 33 5 27 34 26
    YLM 2/05/2009 30 38 37 29 31 24 34
    PKL 4/05/2009 45 6 4 26 16 42 37
    TPL 4/05/2009 28 25 21 6 19 32 22
    DAI 6/05/2009 45 32 34 31 21 42 10
    PKL 7/05/2009 26 42 1 12 34 15 21
    Last edited by lesley_51; 07-05-2009 at 04:27 AM. Reason: more explanation

  6. #6
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,477

    Re: Sorting multiple rows/columns

    try this macro ammended from one i got here
    http://forums.techguy.org/business-a...thin-rows.html (have a look and see the nice friendly thread, NOT lol)

    Code:
    Sub Test()
    Dim RgToSort As Range
    Dim RgRow As Range
    Application.ScreenUpdating = False
    
    Set RgToSort = Range(Range("C1:I1"), Range("C1:I1").End(xlDown))
    
    For Each RgRow In RgToSort.Rows
        RgRow.Sort Key1:=Range(RgRow.Item(1).Address), Order1:=xlAscending, Orientation:=xlLeftToRight, OrderCustom:=1
    Next
    Application.ScreenUpdating = True
    End Sub
    Last edited by martindwilson; 07-05-2009 at 06:31 AM.
    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    07-04-2009
    Location
    Queensland, Australia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Sorting multiple rows/columns

    Thank you martin will try this although never dabbled in macros before. Will be fun

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.2.0