Collabora Office 24.04 Help
傳回陣列的上邊界。
UBound(ArrayName [, Dimension])
Long
ArrayName:要確定其上邊界 (Ubound) 或下邊界 (LBound) 的陣列之名稱。
[Dimension]:用於指定維的整數。函式將傳回此維的上邊界 (Ubound) 或下邊界 (LBound)。如果未指定任何值,則傳回第一維的邊界。
Sub VectorBounds
Dim v(10 To 20) As String
Print LBound(v()) ' 10
Print UBound(v) ' 20
End Sub
Sub TableBounds
Dim t(10 To 20,-5 To 70) As Currency
Print LBound(t), UBound(t()) ' 10 20
Print LBound(t(),2) ' -5
Print UBound(t,2) ' 70
End Sub