multi column sort

jasko

New Member
Joined
Sep 5, 2006
Messages
9
Multiple columns full of numbers needs to be sorted from lowest to highest each column separately. The only way I know is to do each column separately.
Appreciate any help.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,079
Office Version
  1. 365
Platform
  1. Windows
WELCOME TO THE BOARD!

It can be done simultaneously with a macro. Here is a simple little macro that will sort the first 4 columns separately:
Code:
Sub MySort()

'   Sort first 4 columns separately
    Dim i As Long
    For i = 1 To 4
        Columns(i).Sort Key1:=Cells(1, i), Order1:=xlAscending, Header:=xlGuess, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
    Next i
    
End Sub
 

jasko

New Member
Joined
Sep 5, 2006
Messages
9
Many thanks for that JM14, I shall try it............regards.
 

Forum statistics

Threads
1,141,731
Messages
5,708,151
Members
421,549
Latest member
Dtcfire

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top