The UBound Function returns the largest subscript of the specified array. Hence, this value corresponds to the size of the array.
Syntax
UBound(ArrayName[,dimension])
Parameter Description
- ArrayName − A required parameter. This parameter corresponds to the name of the array.
- Dimension − An optional parameter. This takes an integer value that corresponds to the dimension of the array. If it is ‘1’, then it returns the lower bound of the first dimension; if it is ‘2’, then it returns the lower bound of the second dimension, and so on.