Posted on January 4, 2009
1
2
3
4
5
6
| 'Arrays, Collections, Lists - How to evaluate the total number of elements in a two dimensional array
Debug.Print LBound(Cells, 1) ' Displays 1, lower index of 1st dimension
Debug.Print LBound(Cells) ' Same as above
Debug.Print UBound(Cells, 2) ' Displays 20, upper index of 2nd dimension
' Evaluate total number of elements.
NumEls = (UBound(Cells) - LBound(Cells) + 1) * (UBound(Cells, 2) - LBound(Cells, 2) + 1) |