Public Function UBound(ByVal Array As Array(), Optional ByVal Dimension As Long = 1) As Long
Returns the upper boundary of an array. An array of x elements will have an upper boundary of (x-1). Returns 0 for array with 1 element, -1 for uninitialized array.
Dim lArray As String() = {"Monday", "Tuesday", "Wednesday"}
SendDebug UBound(lArray) 'Prints 2, because elements are numbered 0, 1, 2
SendDebug LBound(lArray) 'Prints 0, because elements are numbered 0, 1, 2
SendDebug DimensionCount(lArray) 'Prints 1, because 1 dimension