Prev: putting a picture onto a userform without using the vba window.
Next: new excell will not read old excell file
From: sgltaylor on 27 Nov 2009 17:47 Hi, I am trying to figure out how to do the following: Assume you have a formula like sum (A1:A5) in cell A6. What I need to do is add a sumproduct formula to the existing formula using vba. For example, the formula in cell A6 will be updated to sum(A1:A5)/ SUMPRODUCT((C4:C8=B1)*(D4:D8=B2)) Any ideas or suggestions. Thanks, Steve
From: Don Guillett on 27 Nov 2009 18:31
Basic idea. Modify to suit Sub addtoformulawithvba() With ActiveCell MsgBox .Formula ..Formula = .Formula & "+d2" End With End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett1(a)austin.rr.com "sgltaylor" <stvn.taylor(a)gmail.com> wrote in message news:9d578204-d24c-4fc0-a3d2-e76bd15dba3f(a)a10g2000pre.googlegroups.com... > Hi, > > I am trying to figure out how to do the following: > > Assume you have a formula like sum (A1:A5) in cell A6. > What I need to do is add a sumproduct formula to the existing formula > using vba. > For example, the formula in cell A6 will be updated to sum(A1:A5)/ > SUMPRODUCT((C4:C8=B1)*(D4:D8=B2)) > > Any ideas or suggestions. > > Thanks, > > Steve |