Add it INSIDE the change event. There can only be ONE per tab.
Private Sub Worksheet_Change(ByVal target As Excel.Range)
If target.Address = "$A$1" Then
Application.EnableEvents = False
[a2] = target.Value + [a2]
Application.EnableEvents = True
end if
If target.Address = "$P$1" Then
Application.EnableEvents = False
[p2] = target.Value + [p2]
Application.EnableEvents = True
end if
'etc
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Mex said:
AWESOME, thanks Don that did the trick. Now I’m wondering how to do it
again
on 2 different columns for example K2 & P2 on the same sheet. Is there a
way
to just add to this formula or does it have to be added separately? I
tried
adding it below the original one you provided but it keeps coming up with
the
error message: “ambiguous mane detected worksheet_changeâ€
Thanks you have just saved me an incredible amount of time. ïŠ
Don Guillett said:
Right click sheet tab>view code>copy/paste this.
Now when you put a number in cell a1 cell a2 will increase by that
number.
Private Sub Worksheet_Change(ByVal target As Excel.Range)
If target.Address <> "$A$1" Then Exit Sub
Application.EnableEvents = False
[a2] = target.Value + [a2]
Application.EnableEvents = True
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)
Hi
I want to be able to use one cell to keep adding new numbers to that
will
accumulate the total in another cell.
Ex: I use A1 as the cell to input a new number that will carry a total
in
A2
any help would be appreciated