Knowledge Base

XL: GetCustomListNum Returns Unexpected List Number

Article ID: 134913

Article Last Modified on 1/19/2007


APPLIES TO


This article was previously published under Q134913

SYMPTOMS

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.

WORKAROUND

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
				

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

REFERENCES

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.

Additional query words: XL2002 XL2000 XL98 XL97 XL7 XL5 5.00a 5.00c 7.00a

Keywords: kbprogramming kbprb KB134913