Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining how many dimensions an array has???

Status
Not open for further replies.

ojosVerdes

Technical User
Oct 10, 2002
50
US

Is there a way to determine how many dimensions an array has?

Thanks in advance.


Ed
 
If only I hadn't hacked my code down to a minimalist form in thread222-836312...

 
Minimalist? I seem to recall coding it something like this...

Code:
Function NumberOfDimensions(ivntArray As Variant) As Integer
    Dim dintDimension   As Integer
    Dim dlngUpperBound  As Long
    On Error Resume Next
    For dintDimension = 1 To 65
        dlngUpperBound = UBound(ivntArray, dintDimension)
        If Err.Number <> 0 Then Exit For
    Next
    NumberOfDimensions = dintDimension - 1
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top