View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Array Formulas in VBA

Try evaluating it

Evaluate("MMULT(D6:D105,TRANSPOSE(Sheet2!E3:P3))")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Bill Martin" wrote in message
...
Is there some way to use an array formula within VBA? For example, I find
that I can use a MMULT array formula in VBA with the result posted to a
spreadsheet by using:

Range("AD6:AD105").Select
Selection.FormulaArray = "=MMULT(D6:D105,TRANSPOSE(Sheet2!E3:P3))"

But it would be much better for me if I could put the resulting vector
directly into a VBA array for use rather than back out onto the

spreadsheet.

I can do this with scalar functions that take an array input and produce a
single result such as:

dim Vector(10) as single
... fill the vector ...
X = WorksheetFunction.Max(Vector)

I haven't been able to figure out how to do the analogous thing with built
in worksheet array functions though.

Thanks.

Bill