View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone[_2_] Jim Cone[_2_] is offline
external usenet poster
 
Posts: 1,549
Default Test if a variable is given as array?

In any case, Peter T's code is about 1 or 2 % faster than my function,
over 1,000,000 loops.
--
Jim Cone
Portland, Oregon USA



"Jim Cone"

wrote in message
Peter,
I proposed something similar to this a while back but
never got a reaction...
'--
Function Scrabble(V As Variant) As Boolean
On Error Resume Next
'lower limit for a double
Scrabble = UBound(V, 1) -1.79769313486232E+307
End Function
--
Jim Cone
Portland, Oregon USA



"Peter T"
<peter_t@discussions
wrote in message
I am probably missing something but why not simply -

Function IsArrayAllocated(V As Variant) As Boolean
On Error Resume Next
IsArrayAllocated = (LBound(V, 1) <= UBound(V, 1))
End Function

IOW, in what scenario would the bounds check return true but IsArray(V)
return false.
Regards,
Peter T