Collabora Office 21.06 Help
傳回陣列的上邊界。
UBound(ArrayName [, Dimension])
Long
ArrayName:要確定其上邊界 (Ubound) 或下邊界 (LBound) 的陣列之名稱。
[Dimension]:用於指定維的整數。函式將傳回此維的上邊界 (Ubound) 或下邊界 (LBound)。如果未指定任何值,則傳回第一維的邊界。
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