# Calculation Problem

#### klatlap

##### Well-known Member
I have a small problem to do with calculations foe example in cell A1 if i put this 20 then say in cell B1 it displays 20 but if i erase cell A1 and put 30 what i would like to happen is for Cell B1 to add cell A1 new amount of 30 to it's old amount to give and answer of 50 sobasicly i can keep adding different numbers in cell A1 and it will add them to cell B1...hope you understand what i need....thanks

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

#### just_jon

##### Legend
<font face=Courier New><SPAN style="color:#00007F">Private</SPAN> <SPAN style="color:#00007F">Sub</SPAN> Worksheet_Change(<SPAN style="color:#00007F">ByVal</SPAN> Target <SPAN style="color:#00007F">As</SPAN> Range)
Application.EnableEvents = <SPAN style="color:#00007F">False</SPAN>
<SPAN style="color:#00007F">If</SPAN> <SPAN style="color:#00007F">Not</SPAN> Intersect(Target, [A1]) <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN>
[B1] = [B1] + [A1]
<SPAN style="color:#00007F">ElseIf</SPAN> <SPAN style="color:#00007F">Not</SPAN> Intersect(Target, [B1]) <SPAN style="color:#00007F">Is</SPAN> <SPAN style="color:#00007F">Nothing</SPAN> <SPAN style="color:#00007F">Then</SPAN>
MsgBox "Tsk, Tsk... Keepa you hands off!"
Application.Undo
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
Application.EnableEvents = <SPAN style="color:#00007F">True</SPAN>
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
</FONT>

You can use event code such as the above. When are you planning to reset B1?

Y'know, there used to be a gadget called a calculator...

#### klatlap

##### Well-known Member
Basicly thats what i want it to do add the new total when a new number is entered.....lol...will give that a try

Replies
3
Views
118
Replies
1
Views
144
Replies
1
Views
230
Replies
0
Views
216
Replies
5
Views
507

1,181,740
Messages
5,931,764
Members
436,802
Latest member
Strycure12

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back