vba value in array code example
Example 1: vba array contains
Dim YourArray
YourArray = Array("a", "b", "c")
Debug.Print (UBound(Filter(YourArray, "c")) > -1) ' True
Example 2: vba is array
Dim MyArray(1 To 5) As Integer, YourArray, MyCheck ' Declare array variables.
YourArray = Array(1, 2, 3) ' Use Array function.
MyCheck = IsArray(MyArray) ' Returns True.
MyCheck = IsArray(YourArray) ' Returns True.