Calculation Problem

klatlap

Well-known Member
Joined
Sep 1, 2004
Messages
597
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
Joined
Sep 3, 2002
Messages
10,473
<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
Joined
Sep 1, 2004
Messages
597
Basicly thats what i want it to do add the new total when a new number is entered.....lol...will give that a try
 

Forum statistics

Threads
1,147,620
Messages
5,742,177
Members
423,708
Latest member
vagosh2001

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top