sum a cell value to a range

O

Osmario.Avila

Hi
I need to sum value in A4 to a range B4:B12 every time I enter a new
value in A4.
How can I do it?

Thanks in advance
Osmario
 
J

joeu2004

I said:
=SUM(A4,B4:B12)

Or did you mean that you want to add A4 to each of the cells in B4:B12?

If that is the case, the easiest thing is usually to change whatever you
have in B4 through B12 to a formula that includes +A4. For example, if B4
is =C4-D4, change it to =C4-D4+A4.

If there is some reason why neither of those suggestions (the previous one
and the current one) works for you, explain why not. Show us what is in A4
and B4:B12. Provide some concrete examples.

PS: Of course, you could add a statement to at Worksheet_Change event
macro. But that might be "killing an ant with a sledgehammer". "Everything
should be made as simple as possible, but not simpler" --Einstein.
 
C

Claus Busch

Hi Osmario,

Am Mon, 4 Jul 2011 00:16:56 -0700 (PDT) schrieb (e-mail address removed):
I need to sum value in A4 to a range B4:B12 every time I enter a new
value in A4.

your sum in C4. Then in C4 formula:
=SUM(A4,B4:B12)
Rightclick on sheet tab and paste code in the code window:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$4" Then Exit Sub

[C4] = [C4] + [A4]
End Sub


Regards
Claus Busch
 
C

CWatters

Hi
I need to sum value in A4 to a range B4:B12 every time I enter a new
value in A4.
How can I do it?

Thanks in advance
Osmario

Tools -> Options -> Calculation -> Automatic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top