PC Review


Reply
Thread Tools Rate Thread

Add to an Existing formula in a Cell using VBA

 
 
sgltaylor
Guest
Posts: n/a
 
      27th Nov 2009
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)*(D48=B2))

Any ideas or suggestions.

Thanks,

Steve
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      27th Nov 2009
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
(E-Mail Removed)
"sgltaylor" <(E-Mail Removed)> wrote in message
news:9d578204-d24c-4fc0-a3d2-(E-Mail Removed)...
> 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)*(D48=B2))
>
> Any ideas or suggestions.
>
> Thanks,
>
> Steve


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Add adjacent cell value to existing CountIF formula scottia Microsoft Excel Worksheet Functions 9 14th Sep 2008 02:43 AM
Add Cell range based on color of cell to existing formula =?Utf-8?B?SnVsIGluIE9oaW8=?= Microsoft Excel Programming 2 30th Jul 2007 02:18 PM
Modify an existing Cell formula using VBA Matt Microsoft Excel Misc 2 11th Jun 2007 08:50 PM
Subtract cell formula from existing cell formula transferxxx@gmail.com Microsoft Excel Programming 2 12th Dec 2006 12:03 PM
insert a new cell into an existing formula =?Utf-8?B?RGViYmll?= Microsoft Excel Misc 3 14th Mar 2005 06:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:41 PM.