Application.GetCustomListNum Method (Excel)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns the custom list number for an array of strings. You can use this method to match both built-in lists and custom-defined lists.

expression .GetCustomListNum(ListArray)

expression A variable that represents an Application object.

Parameters

Name

Required/Optional

Data Type

Description

ListArray

Required

Variant

An array of strings.

Return Value

Long

This method generates an error if there's no corresponding list.

This example deletes a custom list.

n = Application.GetCustomListNum(Array("cogs", "sprockets", _ 
 "widgets", "gizmos")) 
Application.DeleteCustomList n
Show: