Can I do the following: Cell1+Cell2=NewCell1?

spk4life

New Member
Joined
Oct 18, 2015
Messages
5
I want to be able to have somewhat of an automatic calculator. I want to keep score of certain data into only one cell. For example.

Cell 1 starts off at 0. When I input 5 on cell 2, it adds it to cell 1 and cell 1 becomes 5. If I then input 10 on cell 2, it would add it to cell 1 again and cell 1 would be 15. Cell 2 would stay blank all the time adding whatever number I input, into cell 1.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
You are not able to create a formula to do that or it would result in a circular loop.
You could put this script into your sheet as a sheet change event.
To install this code:

Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window
Then when you entered a number into cell "A2" it would add that number to cell "A1"
Cell "A2" would retain the number previously entered. We cannot change the value in cell "A2" back to nothing or that would create a script loop.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A2")) Is Nothing Then
Cells(1, 1).Value = Cells(1, 1).Value + Cells(2, 1).Value
End If
End Sub
 
Upvote 0
If my previous post is correct try this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B2")) Is Nothing Then
Cells(2, 1).Value = Cells(2, 2).Value + Cells(2, 1).Value
End If
End Sub
 
Upvote 0
So let's say that column A will have a list of participants who are getting scored. Column B will be their current score. Column C will be the score added to their current score.
 
Upvote 0
Try this:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo J
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Target.Offset(0, -1).Value = Target.Offset(0, -1).Value + Target.Value
End If

Exit Sub
J:
MsgBox "Invalid Value"
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,923
Messages
6,175,392
Members
452,640
Latest member
steveridge

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
Back
Top