Array function

Category: Array / Information

Summary

Variant array from arguments.

Syntax

Array(arglist) The required arglist argument is a comma-delimited list of values that are assigned to the elements of the array contained within the Variant. If no arguments are specified, an array of zero length is created.

Example

Example
This example uses the Array function to return a Variant containing an array.
Dim MyWeek, MyDay
MyWeek = Array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
' Return values assume lower bound set to 1 (using Option Base
' statement).
MyDay = MyWeek(2) ' MyDay contains "Tue".
MyDay = MyWeek(4) ' MyDay contains "Thu".

Microsoft Support Page

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

Back to Functions