UBound Function

Syntax:
UBound(var[, dimension])
Group: Variable Info
Description:
Return the highest index.
Parameter Description
dimension Return the highest index for this dimension of var. If this is omitted then return the highest index for the first dimension.
See Also: LBound( ).
Example:

Sub Main
Dim
A(3,6)
Debug
.Print UBound(A) ' 3
Debug
.Print UBound(A,1) ' 3
Debug
.Print UBound(A,2) ' 6
End
Sub