Article ID: 142112
Article Last Modified on 10/11/2006
A1: red
A2: blue
A3: green
A4: yellow
A5: pink
A1: pink
A2: blue
A3: green
A4: blue
A5: yellow
A6: pink
A7: red
A8: blue
A9: red
Sub Custom_Sort()
Range("A1").Sort Key1:=Range("A1"), Order1:= _
xlAscending, Header:=xlGuess, OrderCustom:=6, _
MatchCase:=False, Orientation:= xlTopToBottom
End Sub
NOTE: The number for the "OrderCustom" argument is the position of
your custom list in the list from the Custom Lists tab of the Options
dialog box. The number you use may be different from the one used in
this example. To find out what number you should use, click Options
on the Tools menu, and click the Custom Lists tab. By default, there
are four default sort lists in Microsoft Excel. Their values for the
"OrderCustom" argument would be 2, 3, 4, and 5, respectively.
Therefore, the first custom sort list would be 6. If you have only
the custom sort list created in steps 1 through 3 above, this is the
value you would use for the "OrderCustom" argument. Use this value
because the number 1 item in the list is reserved for the "New List"
item.
A1: red
A2: red
A3: blue
A4: blue
A5: blue
A6: green
A7: yellow
A8: pink
A9: pink
134913 XL: GetCustomListNum Returns Unexpected List Number
tell me about creating custom lists
custom lists
Additional query words: 5.00a 5.00c 8.00 XL97
Keywords: kbdtacode kbhowto kbualink97 KB142112