Well, there seems to be some continuing confusion in your thinking; or
at least in your presentation of "the problem".
IsArray(iVar) will return True if iVar is a multi-celled range or an
array, whether the array was declared as a true Variant() array (or an
array of any other built-in type) or is an array contained within a
Variant variable (whether the array so contained is of type Variant(),
Integer(), String(), or whatever).
So once IsArray has returned True and a range has been ruled out, the
only way for iVar to be a single value is if it is an array (whether or
not contained within a Variant variable) containing a single element--if
it were otherwise a single value, i.e., simply a single value rather
than an array containing a single element, IsArray would have returned
False.
So if you are trying to rule out a single element array (though it's not
clear why--looping from LBound(arr,n) to UBound(arr,n) in each dimension
will deal with both a single element array or a multi-element array),
you can check for that directly.
If the functions in the freely downloadable file at
http://home.pacbell.net/beban are available to your workbook, you can
check for it with ArrayCount(iVar), which will return the number of
elements in the array.
If those functions are not so available then the ArrayCount function is
included below.
As an aside, there are a couple of ways to determine whether an array
was declared as true array or as an array contained within a Variant
variable, but it is not clear to me why that should ever be necessary or
desirable.
Function ArrayCount(InputArray)
'This function counts NOT the number of
'non-blank values in the array, but the
'number of available slots for values,
'whether the slots contain anything or not.
'It's similar to the Count Property [e.g.,
'Range("a1:c3").Count]
Dim j As Long, k As Long
'Convert range to array
'InputArray = InputArray
If IsArray(InputArray) Then
If Not TypeOf InputArray Is Range Then
j = 1: k = 1
On Error Resume Next
Do
k = k * (UBound(InputArray, j) - _
LBound(InputArray, j) + 1)
j = j + 1
Loop While Err.Number = 0
ArrayCount = k
Else
If TypeOf Application.Caller Is Range Then
ArrayCount = "#ERROR! This function accepts only arrays."
Else
MsgBox "#ERROR! The ArrayCount function accepts only arrays.", 16
End If
End If
Else
If TypeOf Application.Caller Is Range Then
ArrayCount = "#ERROR! This function accepts only arrays."
Else
MsgBox "#ERROR! The ArrayCount function accepts only arrays.", 16
End If
End If
End Function
Alan Beban