adding to an exisitng number

D

Dan Chupinsky

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
 
D

Don Guillett

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
 
J

Jim May

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
 
D

Don Guillett

Did you try it?

Use 0 to start over. Then put in 4 then put in 9 to get 13.
 
J

Jim May

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.

Ask a Question

Top