ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   a1+a2=a3 How can I change a2,keep old a2 value & increase a3 (https://www.excelbanter.com/excel-programming/397537-a1-a2%3Da3-how-can-i-change-a2-keep-old-a2-value-increase-a3.html)

wow

a1+a2=a3 How can I change a2,keep old a2 value & increase a3
 
I want to use less columns as possible. I want others to be able to change
one column while previous values are added to increase a3

Gary''s Student

a1+a2=a3 How can I change a2,keep old a2 value & increase a3
 
This example uses only two cells: A1 & A2

Insert the following code in the wroksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Range("A2").Value = Range("A2").Value + Range("A1").Value
Application.EnableEvents = True
End Sub


Whenever a value is entered in A1, its added into A2
--
Gary''s Student - gsnu200745


"wow" wrote:

I want to use less columns as possible. I want others to be able to change
one column while previous values are added to increase a3



All times are GMT +1. The time now is 01:34 PM.

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