VB and VBA Users Source Code: Determine the number of dimensions in an array
[
Home
|
Contents
|
Search
|
Reply
| Previous | Next ]
VB/VBA Source Code
Determine the number of dimensions in an array
By:
Andrew Baker
Email (spam proof):
Email the originator of this post
Date:
Wednesday, September 26, 2001
Hits:
688
Category:
Visual Basic General
Article:
The following code determines the number of dimensions in any array: 'Purpose : Calculates the number of dimensions in an array 'Inputs : avValues The array to determine the number of dimensions 'Outputs : The number of dimensions the array has. 'Author : Andrew Baker 'Date : 25/03/2000 'Notes : Function ArrayNumDimensions(avValues As Variant) As Long Dim lNumDims As Long If IsArray(avValues) Then On Error GoTo ExitSub Do lNumDims = UBound(avValues, ArrayNumDimensions + 1) ArrayNumDimensions = ArrayNumDimensions + 1 Loop End If ExitSub: On Error GoTo 0 End Function
Terms and Conditions
Support this site
Download a trial version of the Excel Workbook Rebuilder