Choose function

Category: Color / Misc

Summary

Choice by index.

Syntax

Choose(index, choice-1, [ choice-2, ..., [ choice-n ]] ) The Choose function syntax has these parts:
Part
Description
indexRequired. Numeric expression or field that results in a value between 1 and the number of available choices.
choiceRequired. Variant expression containing one of the possible choices.

Example

Example
This example uses the Choose function to display a name in response to an index passed into the procedure in the Ind parameter.
Function GetChoice(Ind As Integer)
GetChoice = Choose(Ind, "Speedy", "United", "Federal")
End Function

Microsoft Support Page

https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/choose-function

Back to Functions