ubound vba code example
Example: excel vba ubound on a multidimensional array
'The VBA UBound() function returns the max index of an array.
MsgBox UBound(vArr) '<--max index of the first dimension
'There is an optional second argument called rank (that defaults to: 1)
'that specifies the dimension:
MsgBox UBound(vArr, 2) '<--max index of the second dimension
'VBA array can have up to 60 dimensions.
'All of the above also applise to the LBound() function.