adding to an exisitng number

  • Thread starter Thread starter Guest
  • Start date Start date
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

Dan
 
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
 
Back
Top