sorting a range

C

cjsmith22

i have some code which sorts a league table, firstly by column n (pts),
then if pts are equal - column m (goal diff)

Code:
--------------------
Range("A19:N38").Select
Range("N19").Activate
Selection.sort Key1:=Range("N20"), Order1:=xlDescending, Key2:=Range( _
"M20"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
 
J

Jim Cone

cjsmith22,

1. check that the last column of the worksheet is blank.
2. insert a column at Column O
3. enter the result of column F + Column K in the new Column O
4. sort on range A:19:O38 using O20 as Key3
5. delete Column O

Jim Cone
San Francisco, USA


"cjsmith22"
<[email protected]>
wrote...
i have some code which sorts a league table, firstly by column n (pts),
then if pts are equal - column m (goal diff)
Code:
--------------------
Range("A19:N38").Select
Range("N19").Activate
Selection.sort Key1:=Range("N20"), Order1:=xlDescending, Key2:=Range( _
"M20"), Order2:=xlDescending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top