sort

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

Could someone direct me to the macro that sorts one column first and then
sorts another column based on first column sort. For example:
Before:
B1 1000
A1 1000
A2 1000
C1 1200
After:(numbers sorted first - then within number groups sorted by alphabet.)
C1 1200
A1 1000
A2 1000
B1 1000
 
No macro required:

Choose Data/Sort and select the second column in the Sort by text
box (check the descending checkbox), and the second column in the
Then By text box (check the ascending checkbox).

If you really want a macro:

Range("A1").Sort Key1:=Range("B1"), _
Order1:=xlDescending, _
Key2:=Range("A1"), _
Order2:=xlAscending, _
Header:=xlGuess, _
MatchCase:=False
 
Back
Top