View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Convert array formula into VBA module

Maybe...
dim res as variant
dim myFormula as string

myformula = "IF(BCostCentre="""",SUM((ytd.ccc=VALUE($C19)) " _
& "*(ytd.ccd=VALUE(rep.fund))*(ytd.act))," _
& "SUM((ytd.ccb=VALUE(BCostCentre))*(ytd.ccc=VALUE($ C19))", _
& "*(ytd.ccd=VALUE(rep.fund))*(ytd.act)))"

res = worksheets("somesheetnamehere").evaluate(myformula )

(Untested.)

If that doesn't work, share that snippet of code.

Forgone wrote:

On Oct 31, 9:22 pm, Dave Peterson wrote:
Does this mean that the Evaluate function worked?


I tried it, and it doesn't appear to be working at all.
This is the entire function that works.

{=IF(BCostCentre="",SUM((ytd.ccc=VALUE($C19))*(ytd .ccd=VALUE(rep.fund))*(ytd.act)),SUM((ytd.ccb=VALU E(BCostCentre))*(ytd.ccc=VALUE($C19))*(ytd.ccd=VAL UE(rep.fund))*(ytd.act)))}


--

Dave Peterson