Macro with custom sort order

  • Thread starter Thread starter Erin
  • Start date Start date
E

Erin

I'm having trouble with the code for a macro that needs a custom sort order
for the second sort key.

I have three sort keys -- the first and third are regular sorts, but the
second needs to sort by custom list 6. Does anyone know how to do this?
 
Are you using the Excel Sort feature or does your macro include a sort
algorithm?
If the later: add a table into the code like this
Red 1
Blue 2
Green 3
Now use the number in the second column as a sorting proxy for the value in
the first column
best wishes
 
If you use xl2003 and try to do this manually, you'll see that you can only
specify the primary key for the custom sort order.

You could do multiple sorts, though.

One sort by the 2nd and 3rd key, then one more sort for the 1st key.
 
Thanks so much -- this worked perfectly!

Dave Peterson said:
If you use xl2003 and try to do this manually, you'll see that you can only
specify the primary key for the custom sort order.

You could do multiple sorts, though.

One sort by the 2nd and 3rd key, then one more sort for the 1st key.
 
Back
Top