Custom sorting *not* using a custom list

colinlee

New Member
Joined
Mar 9, 2005
Messages
9
I've tried to use the custom list function to sort data using Excel 2007, but it's apparently limited to a list of 255 items whereas I have about 3000.

Can anyone help me with macro code to sort a selection based on the order of a list in a separate workbook/worksheet? (list will be stored in my personal macro workbook)

Thanks in advance...
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
You could have a list of values in sort order someplace, and in a separate column, use a MATCH formula to retrieve the position of the sort value in the list. Then sort by that column.
 
Upvote 0
Hmmmm... that's an interesting idea. I created a new column and used a vlookup formula to assign a number to each name in the list:

=VLOOKUP(A2,'[Macro library.xls]LIST09'!A$2:H$2153,8,FALSE)

Not sure how this could be done with a Match formula.

Anyone have a macro solution?

Thanks shg4421!
 
Upvote 0
Not sure how this could be done with a Match formula.
If you have a list of the keys in the desired sort order, then

=MATCH(rowkey, keylist, 0)

returns the sort value.
 
Upvote 0
OK. I looked up some information about how to use it... it's always neat to learn to use a new tool! Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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
Back
Top