View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Calling Excel array functions in VBA

Ok, I guess it doesn't need to be treated as an array funtion: A1:A10 has
the integers 1 to 10.

varr = Application.Small(Range("A1:A10"),Array(1,2,3))
? varr(1)
1
? varr(2)
2
? varr(3)
3

To the OP, in General, to handle most array functions, you use evaluate
which is like a virtual cell on the activesheet.


Regards,
Tom Ogilvy

"Bob Phillips" wrote in message
...
I thought this, but it just gives me an error 2015.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Tom Ogilvy" wrote in message
...
varr = Evaluate("SMALL(A1:10,{1,2,3})")

--
Regards,
Tom Ogilvy

"JM" wrote in message
...
Is it possible to call an Excel array function in VBA?

For instance, in a worksheet, one can execute
{=SMALL(A1:10,{1,2,3})}

Can a similar call be made in a VBA module? If so, what
is the syntax and how is the result returned?