Returns the largest available subscript for the indicated dimension of an array.


UBound(arrayname[, dimension]) 
Arguments
 arrayname

Required. Name of the array variable; follows standard variable naming conventions.
 dimension

Optional. Whole number indicating which dimension's upper bound is returned. Use 1 for the first dimension, 2 for the second, and so on. If dimension is omitted, 1 is assumed.
Remarks
Requirements
See Also