ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   adding to an exisitng number (https://www.excelbanter.com/excel-discussion-misc-queries/33584-adding-exisitng-number.html)

baggie

adding to an exisitng number
 
with a pre-existing number in a cell, hoew do I add another number to it?

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 EditCopy, put your cursor in A1, use
EditPaste Special and choose Add, and click OK

Dan

"baggie" wrote in message
...
with a pre-existing number in a cell, hoew do I add another number to it?




Don Guillett

right click sheet tabview codeinsert thismodify to suitSAVE.

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 Guillett
SalesAid Software

"baggie" wrote in message
...
with a pre-existing number in a cell, hoew do I add another number to it?




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

"Don Guillett" wrote in message
...
right click sheet tabview codeinsert thismodify to suitSAVE.

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 Guillett
SalesAid Software

"baggie" wrote in message
...
with a pre-existing number in a cell, hoew do I add another number to it?






Don Guillett

Did you try it?

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

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:qDRxe.71596$Fv.4063@lakeread01...
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

"Don Guillett" wrote in message
...
right click sheet tabview codeinsert thismodify to suitSAVE.

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 Guillett
SalesAid Software

"baggie" wrote in message
...
with a pre-existing number in a cell, hoew do I add another number to

it?







Jim May

Tks, Don
I'm temporarily "without" excel on my PC.
I'll try it when it is available (soon, I hope).
Jim

"Don Guillett" wrote in message
...
Did you try it?

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

--
Don Guillett
SalesAid Software

"Jim May" wrote in message
news:qDRxe.71596$Fv.4063@lakeread01...
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

"Don Guillett" wrote in message
...
right click sheet tabview codeinsert thismodify to suitSAVE.

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 Guillett
SalesAid Software

"baggie" wrote in message
...
with a pre-existing number in a cell, hoew do I add another number to

it?










All times are GMT +1. The time now is 08:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com