Funció Ubound
Torna el límit superior d'una matriu.
UBound (ArrayName [, Dimension])
Long
ArrayName: Nom de la matriu per a la qual voleu determinar el límit superior (Ubound) o inferior (LBound).
[Dimension]: Enter que especifica quina dimensió tornar per al límit superior (Ubound) o inferior (LBound). Si no s'especifica cap valor, es torna el límit de la primera dimensió.
Sub VectorBounds
Dim v(10 To 20) As String
Print LBound(v()) ' returns 10
Print UBound(v) ' returns 20
End Sub ' VectorBounds
Sub TableBounds
Dim t(10 To 20,-5 To 70) As Currency
Print LBound(t), UBound(t()) ' returns 10 20
Print LBound(t(),2) ' returns - 5
Print UBound(t,2) ' returns 70
End Sub ' TableBounds