Syntax

expression.AddCustomList(ListArray, ByRow)

expression A variable that represents an Application object.

Parameters

Name Required/Optional Data Type Description
ListArray Required Variant Specifies the source data, as either an array of strings or a Range object.
ByRow Optional Variant Only used if ListArray is a Range object. True to create a custom list from each row in the range. False to create a custom list from each column in the range. If this argument is omitted and there are more rows than columns (or an equal number of rows and columns) in the range, Microsoft Excel creates a custom list from each column in the range. If this argument is omitted and there are more columns than rows in the range, Microsoft Excel creates a custom list from each row in the range.

Remarks

If the list you're trying to add already exists, this method does nothing.

Example

This example adds an array of strings as a custom list.

Visual Basic for Applications
Application.AddCustomList Array("cogs", "sprockets", _ "widgets", "gizmos")
add custom list Add Custom List Method addcustom AddCustomList AddCustomList Method AddCustomList? Create a specialized list from a bunch of rows? Input a custom table of values for autofill? Make my own list for sorting? Use a number of columns as autofill data?

See also: