If your pre-existing number is in A1 and you wish to add the number in B1 to
it, put you cursor in B1, use Edit>Copy, put your cursor in A1, use
Edit>Paste Special and choose Add, and click OK
right click sheet tab>view code>insert this>modify to suit>SAVE.
Dim oldvalue As Double
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$5" Then
On Error GoTo fixit
Application.EnableEvents = False
If Target.Value = 0 Then oldvalue = 0
Target.Value = 1 * Target.Value + oldvalue
oldvalue = Target.Value
fixit:
Application.EnableEvents = True
End If
End Sub
Don,
If in cell A1 (value to be changed) = 4 and if in cell A5 OP enters 9
I interpret request that he wants A1 to become 13.
If so, don't we need to assign oldvalue = 4 before hand?
Appreciate your input..
Jim
Tks, Don
I'm temporarily "without" excel on my PC.
I'll try it when it is available (soon, I hope).
Jim
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.