XL: GetCustomListNum Returns Unexpected List Number (134913)



The information in this article applies to:

  • Microsoft Excel 2000
  • Microsoft Excel 2002
  • Microsoft Excel 97 for Windows
  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 95 7.0a
  • Microsoft Excel for Windows 5.0
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows NT 5.0
  • Microsoft Excel 98 Macintosh Edition
  • Microsoft Excel for the Macintosh 5.0
  • Microsoft Excel for the Macintosh 5.0a

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.

Modification Type:MinorLast Reviewed:10/10/2006
Keywords:kbprb kbProgramming KB134913