Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Hi Everyone-
I suspect that this question has been asked before but it is difficult to know how to find the correct thread. That being said, here it goes. I would like to make a cell continually add values entered into them. For example, I have a cell that has a value of $12.37 and I have to add to it a new value as I encounter it, lets say $8.73. As it stands know, I pull out my trusty calculator andsum up the two values and key in the sum into the field. I have a pile of recites that I need to add as they come up. Any help is greatly appreciated. Manuel A. Ayala CAD Concepts, LLC |
#2
![]() |
|||
|
|||
![]()
Private Sub Worksheet_Change(ByVal target As Range)
Static nAmount On Error GoTo ws_exit: Application.EnableEvents = False If target.Address(False, False) = "H10" Then target.Value = target.Value + nAmount nAmount = target.Value End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "CAD Concepts" wrote in message ... Hi Everyone- I suspect that this question has been asked before but it is difficult to know how to find the correct thread. That being said, here it goes. I would like to make a cell continually add values entered into them. For example, I have a cell that has a value of $12.37 and I have to add to it a new value as I encounter it, lets say $8.73. As it stands know, I pull out my trusty calculator andsum up the two values and key in the sum into the field. I have a pile of recites that I need to add as they come up. Any help is greatly appreciated. Manuel A. Ayala CAD Concepts, LLC |
#3
![]() |
|||
|
|||
![]() Hi Bob- I pasted the code as you suggested but I must be missing something because it doesn't seem to work. Do I have set some format in the cell to make it work? Also, when inputting do I just click on the cell and enter the value I want added to the existing.? Please advise. Thanks. Manuel "Bob Phillips" wrote: Private Sub Worksheet_Change(ByVal target As Range) Static nAmount On Error GoTo ws_exit: Application.EnableEvents = False If target.Address(False, False) = "H10" Then target.Value = target.Value + nAmount nAmount = target.Value End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "CAD Concepts" wrote in message ... Hi Everyone- I suspect that this question has been asked before but it is difficult to know how to find the correct thread. That being said, here it goes. I would like to make a cell continually add values entered into them. For example, I have a cell that has a value of $12.37 and I have to add to it a new value as I encounter it, lets say $8.73. As it stands know, I pull out my trusty calculator andsum up the two values and key in the sum into the field. I have a pile of recites that I need to add as they come up. Any help is greatly appreciated. Manuel A. Ayala CAD Concepts, LLC |
#4
![]() |
|||
|
|||
![]()
Yes, all you do is enter values. Note the point at the end about where you
put the code. Be aware that this starts afresh for each excel seesion.. -- HTH RP (remove nothere from the email address if mailing direct) "CAD Concepts" wrote in message ... Hi Bob- I pasted the code as you suggested but I must be missing something because it doesn't seem to work. Do I have set some format in the cell to make it work? Also, when inputting do I just click on the cell and enter the value I want added to the existing.? Please advise. Thanks. Manuel "Bob Phillips" wrote: Private Sub Worksheet_Change(ByVal target As Range) Static nAmount On Error GoTo ws_exit: Application.EnableEvents = False If target.Address(False, False) = "H10" Then target.Value = target.Value + nAmount nAmount = target.Value End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH RP (remove nothere from the email address if mailing direct) "CAD Concepts" wrote in message ... Hi Everyone- I suspect that this question has been asked before but it is difficult to know how to find the correct thread. That being said, here it goes. I would like to make a cell continually add values entered into them. For example, I have a cell that has a value of $12.37 and I have to add to it a new value as I encounter it, lets say $8.73. As it stands know, I pull out my trusty calculator andsum up the two values and key in the sum into the field. I have a pile of recites that I need to add as they come up. Any help is greatly appreciated. Manuel A. Ayala CAD Concepts, LLC |
#5
![]() |
|||
|
|||
![]()
Hi,
If you do not get a reasonable response from this forum, you can send your worksheet to me and maybe I can write a macro to dothe task. See some of my excel stuff at: http://www.geocities.com/excelmarksway regards mark -----Original Message----- Hi Everyone- I suspect that this question has been asked before but it is difficult to know how to find the correct thread. That being said, here it goes. I would like to make a cell continually add values entered into them. For example, I have a cell that has a value of $12.37 and I have to add to it a new value as I encounter it, lets say $8.73. As it stands know, I pull out my trusty calculator andsum up the two values and key in the sum into the field. I have a pile of recites that I need to add as they come up. Any help is greatly appreciated. Manuel A. Ayala CAD Concepts, LLC . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can I select two different values for a cell? | Excel Worksheet Functions | |||
limit choice in cell to one of two values; | Excel Discussion (Misc queries) | |||
Can a Formula in Cell X modify Cell Y? | Excel Discussion (Misc queries) | |||
Addition to Turn cell red if today is greater or equal to date in cell | New Users to Excel | |||
Stumped! Collecting values into one cell. | Excel Worksheet Functions |