Macro with custom sort order

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?
 
B

Bernard Liengme

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
 
D

Dave Peterson

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.
 
E

Erin

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.
 

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