Description Function

Returns an indexed description from value/description list.

Description (index, list)

Parameters

Index  -  (Input, expression, Required)

Specifies the index of the expression to return. It must be within the range of 1 to the total number of value/description pairs listed. If index is 1, the 1st expression is returned. If index is 2, the 2nd expression is returned, and so on. If a string value is passed, it will be converted first to an integer. If index is a floating-point value, it is rounded to the nearest integer. If index is less than 1 or greater than the total number of choices, then the result is Error. A non-numeric index also returns Error.

List  -  (Input, expression, Required)

Specifies one or more semi-colon-delimited value/description pairs. All of these pairs are listed in a single String expression.

Return Value

The description of the nth expression, indexed by the index parameter.

Examples

Description (1, "A=Option1;B=Option2")

Returns "Option1".

Description (2, "A=Option1;B=Option2")

Returns "Option2".

Description (3, "A=Option1;B=Option2")

Returns Error.

TIP:

Functions are specifically for use in the Macro Editor. Refer to Microsoft's official VB and JScript documentation for scripting equivalents.

See Also

Functions | Choose function | Description function | Iff function | In function | Lookup function | Switch function | Value function


© 2004-2021 looksoftware. All rights reserved.