Neutralizer
Board Regular
- Joined
- Sep 23, 2009
- Messages
- 53
I have the following formula:
{=NumberOfArrayDimensions(IF(RR_Date_Check=Input_Prod_DATE,Input_Prod_RR_LABEL,""))}
RR_Date_Check is a named range for a single cell (i.e. $D$1)
Input_Prod_DATE is a named range (i.e. $A$1:$A$100)
Input_Prod_LABEL is a corresponding named range (i.e. $B$1:$B$100)
Can anyone explain to me why this is producing an array with more than 1 dimension? (i'm using a reliable VBA function to determine the number of dimensions in the array, it's coming back as 2...). To my mind this should produce a 1x100 array full of text strings (i.e. RR_Prod_Labels) or blanks cells (i.e. "")...where the hell is the second dimension coming from?
VBA function:
{=NumberOfArrayDimensions(IF(RR_Date_Check=Input_Prod_DATE,Input_Prod_RR_LABEL,""))}
RR_Date_Check is a named range for a single cell (i.e. $D$1)
Input_Prod_DATE is a named range (i.e. $A$1:$A$100)
Input_Prod_LABEL is a corresponding named range (i.e. $B$1:$B$100)
Can anyone explain to me why this is producing an array with more than 1 dimension? (i'm using a reliable VBA function to determine the number of dimensions in the array, it's coming back as 2...). To my mind this should produce a 1x100 array full of text strings (i.e. RR_Prod_Labels) or blanks cells (i.e. "")...where the hell is the second dimension coming from?
VBA function:
Code:
Function NumberOfArrayDimensions(Arr As Variant) As Long
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' NumberOfArrayDimensions
' This returns the number of dimensions of the array
' Arr. If Arr is not an array, the result is 0.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim LB As Long
Dim N As Long
On Error Resume Next
N = 1
Do Until Err.Number <> 0
LB = LBound(Arr, N)
N = N + 1
Loop
NumberOfArrayDimensions = N - 2
End Function
Last edited: