Adding up several cells

  • Thread starter Thread starter JD
  • Start date Start date
J

JD

I'm sure this is really easy but I am getting into circular reference
errors - I have two cells - one is a running total the other a user input
figure that needs to be appended to the running total every time. so if the
running total stands at 0, the user inputs 10 into the second cell and the
running total updates to 10. If the second cell is then changed to 15, the
running total should reflect 25. Is this possible??

thanks
 
Right click sheet tab>view code>insert this.
Now when you change a3 cell b3 will reflect the increase

Private Sub Worksheet_Change(ByVal target As Excel.Range)
If Intersect(target, Range("a1:a13")) Is Nothing _
Or IsNumeric(target) = False Then Exit Sub
Application.EnableEvents = False
target.Offset(, 1) = target.Offset(, 1) + target
Application.EnableEvents = True
End Sub
 
Back
Top