UBound (function)

<< Click to Display Table of Contents >>

UBound (function)

UBound(ArrayName[, Dimension])

Returns the highest index of the given dimension of an array.

If Dimension is not indicated, the first dimension of the array is used.

See also: Dim, LBound, ReDim

Example:

Option Base 1

Sub Main

 Dim a(10, 20 To 40)

 Print "1st dimension: " & LBound(a) & " to " & UBound(a)

 Print "2nd dimension: " & LBound(a, 2) & " to " & UBound(a, 2)

End Sub