The GetCustomListNum method returns a number that is one less than the expected number when you use it to evaluate an array containing a custom list. When you use the number returned by the GetCustomListNum method as the OrderCustom argument for the Sort method, Microsoft Excel will still sort values using the default sort order and not the custom sort order as expected.
↑ Back to the top
To work around this problem, add one to the number returned by the
GetCustomListNum method for use within a procedure, as in the following example:
Application.GetCustomListNum + 1
↑ Back to the top
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
↑ Back to the top
For more information about the GetCustomListNum method, in the Visual Basic Editor, click Microsoft Visual Basic Help on the Help menu, type GetCustomListNum method in the Office Assistant or the Answer Wizard, and then click Search to view the topic.
Excel Visual Basic for Applications Reference, version 5.0, page 289, by Microsoft Press.
↑ Back to the top