Home > How-To Library > Arrays, Collections, Lists
How to find out the number of dimensions of the given array
**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * **************************************************************** '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
If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.