Use another cell to permanently change value of another cell

Payupright

New Member
Joined
Apr 4, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey there, I am not sure if this is even possible, but I am basically trying to make a calculator of sorts. I would like to be able to enter a value into I3 and add/subtract it from C3, but I would then like for C3 to remain that new value and I3 be reset to 0 without removing the previous value from C3 (So a simple SUM won't work here as it does not cause a permanent change to another cell). Again, I am not sure if this is even possible, or if what I am wanting to do makes much sense.

Any assistance is greatly appreciated :)
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
@Payupright You will need to use vba to achieve the above.

Assuming that you will enter negative values to ahieve subtraction then this simple Worksheet _Change event should do it.


VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Then Exit Sub
If Not (IsNumeric(Target) And IsNumeric(Range("C3"))) Then Exit Sub
If Not Intersect(Target, Range("I3")) Is Nothing Then
Application.EnableEvents = False
    Range("C3") = Range("C3") + Target
    Target = ""
    Target.Select
Application.EnableEvents = True
End If

End Sub

Paste it into the code module of the relevant sheet.

Hope that helps.
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,214,971
Messages
6,122,517
Members
449,088
Latest member
RandomExceller01

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