How to perform cumulative addition in excel V6=V6+T6

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to ask how to initialize a cell with a value and also I want to
perform calculation like..the previous value gets added to current value..
like I have value in cell
T6=23
initially V6=0
now V6=V6 + T6
ie V6= 23
Now I want to change T6=20
So the Value of V6 now becomes = 43
 
Sadhana,

You can do it using the change event.

Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the
window that appears.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$T$6" Then Exit Sub
Application.EnableEvents = False
Range("V6").Value = Range("V6").Value + Target.Value
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top