+ Reply to Thread
Results 1 to 4 of 4

VBA to sort multiple columns in ascending order

Hybrid View

dmcg9760 VBA to sort multiple columns... 03-05-2023, 12:07 AM
jindon Re: VBA to sort multiple... 03-05-2023, 12:54 AM
dmcg9760 Re: VBA to sort multiple... 03-05-2023, 01:22 AM
jindon Re: VBA to sort multiple... 03-05-2023, 01:28 AM
  1. #1
    Registered User
    Join Date
    04-06-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    VBA to sort multiple columns in ascending order

    Hi All


    I have a worksheet that I am trying to sort the numbers on


    I am wanting help writing a macro to sort multiple columns into descending order, column by column ( no headers )
    from column A to IU , all columns have 7 rows each.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to sort multiple columns in ascending order

    Is this what you are after?
    Sub test()
        Dim i As Long
        With [a1].CurrentRegion
            For i = 1 To .Columns.Count
                .Columns(i).Sort .Columns(i), 2
            Next
        End With
    End Sub

  3. #3
    Registered User
    Join Date
    04-06-2014
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: VBA to sort multiple columns in ascending order

    Hi Jindon

    Fantastic , exactly what I was looking for

    Many Thanks

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: VBA to sort multiple columns in ascending order

    You are welcome.

    For your reference, simple and easy old fashioned sort method

    https://learn.microsoft.com/en-us/of...cel.range.sort

+ 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. [SOLVED] Sort numbers within named range, in ascending order, across multiple rows
    By edwaves in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-26-2021, 11:55 AM
  2. [SOLVED] VBA to sort ascending in multiple columns
    By tiger99 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2019, 01:15 AM
  3. Replies: 5
    Last Post: 03-24-2018, 06:29 PM
  4. [SOLVED] I need to create an ascending sort across multiple columns
    By zookeepertx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2015, 05:49 PM
  5. Replies: 13
    Last Post: 12-19-2013, 11:06 PM
  6. how to arrange multiple columns in ascending order
    By sanjay2210.msl in forum Excel General
    Replies: 2
    Last Post: 10-29-2013, 08:26 AM
  7. How to select two columns of values and sort them into ascending order,but w/o moving them
    By jonathancook in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2013, 05:51 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