Value Function

Returns an indexed value from value/description list.

Value ( 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 value of the nth expression, indexed by the index parameter.

Examples

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

Returns "A"

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

Returns "B"

Value (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.