Range or Array?
Bob Phillips wrote:
"Alan Beban" wrote in message
...
Consider:
If IsArray(rng) Then
If TypeOf rng Is Range Then
MsgBox "Range"
Else
MsgBox "Array"
End If
End If
I decided to cater for other types passed as well.
But what happens to:
Sub abtest2()
Dim rng() As Integer
If TypeName(rng) = "Range" Then
MsgBox "Range"
ElseIf TypeName(rng) = "Variant()" Then
If IsArray(rng) Then
MsgBox "Array"
End If
End If
End Sub
In my code, the second line should be
If Typename(rng) = "Range" Then
Alan Beban
|