Untested, uncompiled.
dim myVal as double
dim myFormula as string
dim iRow as long
for irow = 1 to 9
myformula = "SUM(G" & iRow & ":I" & iRow & ")/TRANSPOSE($M$2:$M$4)*O" & iRow
myval = activesheet.evaluate(myformula)
'do something with myval
next irow
> i have an array formula that i'd like to evaluate in code and store it in a
> variable instead of creating the array formula.
[quoted text clipped - 11 lines]
>
> Gary

Signature
Dave Peterson
Gary Keramidas - 15 Apr 2008 02:49 GMT
didn't seem to work, dave. i have some code that loops through the range and
gives me the result i need. i was wondering about a formula.
thanks

Signature
Gary
> Untested, uncompiled.
>
[quoted text clipped - 24 lines]
>>
>> Gary
Dave Peterson - 15 Apr 2008 02:54 GMT
Does the formula work when you type it into a cell?
If yes, share that formula that worked.
> didn't seem to work, dave. i have some code that loops through the range and
> gives me the result i need. i was wondering about a formula.
[quoted text clipped - 37 lines]
> >
> > Dave Peterson

Signature
Dave Peterson
Gary Keramidas - 15 Apr 2008 03:38 GMT
here's a similar formula that sort of works. i explain it in a separate post
because i was just looking for a formula, not a value to store in a variable.
=(SUM((1-TRANSPOSE(H2:H4))*G22:I22)+SUM(G22:I22))/TRANSPOSE($M$2:$M$4)

Signature
Gary
> Does the formula work when you type it into a cell?
>
[quoted text clipped - 44 lines]
>> >
>> > Dave Peterson