Posted on January 4, 2009
1
2
3
4
5
6
7
8
9
10
11
12
| 'Arrays, Collections, Lists - How to find out the number of dimensions of the given array
'This routine returns the number of dimensions of the array passed as
'an argument, or 0 if it isn't an array.
Function NumberOfDims(arr As Variant) As Integer
Dim dummy As Long
On Error Resume Next
Do
dummy = UBound(arr, NumberOfDims + 1)
If Err Then Exit Do
NumberOfDims = NumberOfDims + 1
Loop
End Function |