Same cell addition

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

If I have a quanity in cell A1, lets say it's 20 and I
want to add lets say 2. Is there a way for excel to
remember the 20 and change the number to 22 without having
to physically change it to =20+2.
20 already in cell A1
Now I'm changing the 20 to 2 in cell A1
The end result should be 22 in cell A1
Thanks in advance!!!
 
Need a macro to do it.
It's done with events. In the SelectionChange Event, store the contents in a
varilable. In the Change Event, turn off events, add the variable stored in
the first part to the active cell, turn events on. :
Right-click the sheet tab, select View code, paste this in:
Dim Var

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Value = Target.Value + Var
Application.EnableEvents = True
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Var = Target.Value
End Sub


Enjoy.
Bob Umlas
Excel MVP
 
Works great! Is there a way to target just column "C".
Thanks so much for your help!!
 
Back
Top