Continuall Add ing values in a cell

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
0
3/26/2005 11:15:01 PM
excel.misc 78881 articles. 5 followers. Follow

4 Replies
273 Views

Similar Articles

[PageSpeed] 5

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" <CADConcepts@discussions.microsoft.com> wrote in message
news:DEE51D93-2B5F-48E3-ABB3-40BFFCBFCAE8@microsoft.com...
> 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


0
bob.phillips1 (6510)
3/27/2005 12:29:26 AM
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" <CADConcepts@discussions.microsoft.com> wrote in message
> news:DEE51D93-2B5F-48E3-ABB3-40BFFCBFCAE8@microsoft.com...
> > 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
> 
> 
> 
0
3/27/2005 12:51:05 AM
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
>.
>
0
3/27/2005 1:48:58 AM
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" <CADConcepts@discussions.microsoft.com> wrote in message
news:BD36D547-53C6-4AA2-9A21-22E38945883C@microsoft.com...
>
> 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" <CADConcepts@discussions.microsoft.com> wrote in message
> > news:DEE51D93-2B5F-48E3-ABB3-40BFFCBFCAE8@microsoft.com...
> > > 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
> >
> >
> >


0
bob.phillips1 (6510)
3/27/2005 10:36:28 AM
Reply:

Similar Artilces:

Adding time values
Hi to all, I'm trying to add time values together, EG: 1:30 (90minutes) + 0:30 (30 minutes) to return a value of 2:00 Is it possible to do this in Excel? Thanks in advance, John. Yes, just put the two times in separate cells, and add them =A1+A2 -- HTH RP (remove nothere from the email address if mailing direct) "Johnty" <johnmcgibbon@msn.com> wrote in message news:1113600171.db49c715fe9c4e0642762c5471fb6105@teranews... > Hi to all, > > I'm trying to add time values together, > > EG: 1:30 (90minutes) + 0:30 (30 minutes) to return a value of...

How to add Yahoo Email POP?
Dear All, I have installed Window Live Mail via MSN. I would like to add Yahoo POP email account? I tried using the below configuration which I can find in Yahoo Help. But whenever I pressed the Sync button, it prompts me the below errors. Pls help. CONFIGURATION =========== POP Yahoo! Mail with Another Email Client ============================= Want to use another email program to send and receive Yahoo! Mail messages? If so, you'll be asked to designate a new incoming (POP3) mail server and a new outgoing (SMTP) mail server. Here are the basic server settings for Yahoo...

Using PERCENTILE with *specific* cells in a column
I am trying to use the PERCENTILE function with specific cells in a column. For example, lets say the column is: A 1 5 2 6 3 7 4 8 Using PERCENTILE on say A1:A3 is easy enough, but I want to do say A1 and A4. I can achieve this by defining a named range such that it would be equal to A1 and A4, but would rather not use named ranges, as the above is a very simplistic example of what I want to do -- using named ranges would require a substantial amount of effort to achieve my end goal. I also realize I could re-order the rows such that I swap A4 with A2, therefore could use perc...

Incrementing named cells
Merry Christmas everyone!!! Was wondering if any of you can help me with this. I have a financial model that currently has numerous named cells in the format of XXX_03 ( the 03 is to denote 2003 ) but I am making 2004 projection and therefore am wondering if there was an easy way to sort of copy and paste the names into a new column and automically renaming cells by an increment of 1 to XXX_04. If anyone can help, it will be greatly appreciated! Thank you Justin See one answer 1 minute later -- Don Guillett SalesAid Software donaldb@281.com "Justin" <jsim_hba2003@hot...

Wrap Text in Merged Cell
Excel 2007 If I merge several (or even 2) cells in a row, I can not get the text to wrap when I hit enter. It works, of course, in a single cell. How can I get the text to wrap in merged cells? I have checked "Wrap text" in the Format Cells dialog box, Thanks, Bob Atkinson Long audible sigh here................. One more victim of "merged cells". Wrap Text works fine on merged cells, but Autofit does not work. You need VBA event code to do that. Here is code from Greg Wilson. Private Sub Worksheet_Change(ByVal Target As Range) Dim NewRwHt As Single Dim cW...

sum a field value in all querys
hello everyone How do i sum a value with another field (always the same one) in all my querys? Later, i would like to change that value to see the result in all querys. How do i do that? Please explain me best you can do cose i'm not an expert on access. Tks in advance Pedro Hi Pedro, What is the data type of the other field (always the same one)? The value you wish to sum it with - what data type is it? For example: if you had a query where one field was called rating and it was a long integer, if you wanted to add the value 4 to this you could create a calculated field in the que...

Tab into specified cells
I'm looking to set up a worksheet so that when I open it up I can only tab into specific cells. Is there anyway of doing this? Thanks There are a few way. One is to unlock the cells you want to tab into (Format>Cells>Protection), and then lock the sheet (Tools>Protection>Protect Sheet) -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "sho" <anonymous@discussions.microsoft.com> wrote in message news:644601c47543$7c069000$a401280a@phx.gbl... > I'm looking to set ...

Find all cells with a number and mulitply
How can I find all cells in a sheet that are a number greater than zero and multiply each one by a number? IE: the number to multiply by is 1.2 A1 Tom A2 25 A3 0 G12 Bob G13 25 I want to programatically (without using a macro) find cells a2 and g13 only and multiply them by 1.2 Thanks in advance for your help. Jim Jim, As long as you don't have any negative numbers, it doesn't matter about being > 0 (0*n=0) or being text. Try this Put 1.2 in a spare cell and then copy it Select all the cells Goto menu Edit>Pastespecial Click the Multiply option OK out Now clear the c...

Cell comments
I have already created the code using VBA to pull the data from the M Access table. Is there a way to set it up so that when you pass ove the cell it will automatically run my routine -- LA ----------------------------------------------------------------------- LAF's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=965 View this thread: http://www.excelforum.com/showthread.php?threadid=26920 Hi not possible AFAIK as there's no event which got triggered by just moving over a comment field -- Regards Frank Kabel Frankfurt, Germany LAF wrote: > I have alr...

Merging cells #4
I am using an existing worksheet in Excel. Some cells have already been merged. I need to merge 2 more cells and i am unable to accomplish that. The "merge/center button" on the toolbar is not highlighted, so i am unable to merge the needed cells. Any suggestions? Any chance your worksheet is protected? brownk wrote: > > I am using an existing worksheet in Excel. Some cells have already been > merged. I need to merge 2 more cells and i am unable to accomplish that. > The "merge/center button" on the toolbar is not highlighted, so i am unable > to m...

formula field: don't display anything when value is zero (using ;"
hello, I read this under the topic "How to get a formula field to total an entire table column, even if some cells in the column contain text or are blank" on the MVP-site and can't get it to work. I'm interested in the final bit, using ;"" Does anyone know how to do this? <start quotation>... Then in the total cell, press Ctrl+F9, and within the field braces {}, insert the following formula: { SUM(Table1 F:F) \# "#,##0.00;- #,##0.00;''" } “Table1” in the formula refers to the name of the bookmark you've marked the ...

Sometimes can see all text in a cell, sometimes not.
Hello On Sheet1, I can see all text in cells that have lots of text in them, but have cells to the right that are empty. On Sheet 2, I pasted the following formula into cell A1, and copied this into all of the cells on Sheet2: =IF(Sheet1!A1=0,"",Sheet1!A1) Now I can't see all of the text in a cell, even if the cell to the right of it is empty. Is there anything that can be done? I am copying these cells and pasting them into Word as a picture. Thanks! Its because if you type text into a cell it will spill over into empty cells so it can be read. If you then enter in a...

Validation Default Value
I'm using a validation list to populate cell B7 on my worksheet. The choices on this list are dynamic and change based on the value in cell H6. Cell B6 then shows a VLOOKUP value based on the contents of cell B7. The problem is that I often need to change the value of H6 and when I do so it leaves the previous value in cell B7 until a new choice is made from the drop-down list. Is there a way to change the value of cell B7 to be either a blank or maybe make it default to the first choice on the validation list? Thanks for your help. Why would you want to change the value of B7 until...

Cell sizing
Hi everyone, I'm recently new to all of this so I hope this isn't a stupid question. Before using Excel, about 7 or 8 years ago, I used Corel Quattro pro. I was able to set the cell heights and widths in mm, cm , inches, points, etc., so that when I printed a section of a sheet it would be a specific dimension. I haven't been able to do this with Excel. Thanks for your help. Only MacXL 2004 allows you to set height and width directly in inches/cm/mm. Both platforms allow you to set row height in points. Column widths can be set in the number of widths of the zero character in...

Picklist Values start at 200,000?
Has anyone else come accross an issue where, after upgrading to CRM 4, any new picklist values you enter begin with the number 200,000? I have a Lead Source picklist that left off at number 12 in CRM 3.0. When I went into the attribute to add another item (which should have been number 13), it began with number 200,000.??? Thanks. AMCK This is normal behavior in CRM 4 - the custom values start there in a model similar to NAV, AX, etc. That way there is no conflict of new SYSTEM attributes (until they get to 199,000 new attributes that is :) ) on upgrades, sps, etc. If you want a clea...

Average Cells with actuall numbers
Hey all, Hopefully this is a simple one. I'm SUMing a column: =SUM(L8 + L12 + L16) At times, some of these cells might be empty. Can I mod this equation to check for an empty cell? What I'm doing is averaging the numbers in this column by the number of cells that actually have numbers in them. (in this case it would be the sum of L8 + L12 + L16 divided by 3) If, let's say, L8 was empty, I need to divide the total by 2. Make any sense? Thanks for any help! -b Hi Bradley couple of things =SUM(L8+L12+L16) is quite an awkward way of writing either =L8+L12+L16 or =SUM(L8,...

autopopulate sl.no.based on a cell value
I have cell value in work sheet based on a function and it changes accordingly.Based on this cell value I want to populate a serial numbers in a column.suppose c1=15,Iwant to populate from d10:d100 serial number as 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 upto d24 only rest should appear as blank.Iwant this funtion as array that means d10:d100= formula.maximum cell value is around 90.Any idea to get this result. In D10 enter: =IF(ROWS($1:1)<=$C$1,ROWS($1:1),"") and copy down to D100 Hope this helps Rowan TUNGANA KURMA RAJU wrote: > I have cell value in work sheet based on a ...

Searching Multiples Words in cells and returing it in adjacent cell
Hi All, I am new to excel So i have some dat where i need to find and write the manufacturer name,color,Size,material and etc in fifferent cells so i am searching for a formula to search so all the above things and write it in the adjacent cells...for example if the cells has the sentance "Size :Only One Size Bust:92~102CM Across Shoulder:38CM Sleeve Length:59CM Length:75CM Material :Polyester Cotton".so it sould find if the material is Polyester cotton,Cotton,Kint,Sweater or Chiffon and write it wherever needed and same for the other search category. I would be very thankful to y...

Trying to total the column values in my chart?
Hi !! I am using the Stacked Column with a 3-d visual effect chart. I am charting 6 months worth of numbers with 5 values in each column. I would like to add up the totals in each column of my chart to make a heading (or something). Can this be done? Thanks ! K8T Hi, The last section of this page shows you how to add a total to a 3-d stack. http://www.andypope.info/charts/StackColTotal.htm Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "K8T" <K8T@discussions.microsoft.com> wrote in message news:35E21028-5057-4B86-9725-2324FF5DA718@micr...

Opening new form in add mode with preset values
I'm currently working on a personal database to manage family-tree type data and have come across a problem. To note off the bat, I'm very new to Access and am essentially teaching myself as I go by picking apart template databases and playing with my own "test" databases. I only yesterday figured out that most of my hitches now require macros or visual basic coding so I've been trying to learn that too. I figured out how to have a new form open to a related record, and how to have a new form open in add mode, but I'm not sure how to have it open a new form in add mo...

Shading a cell using an if statement
Hi Group, What I am trying to do is to shade a cell when an arguement is true. if(a3=10,shade cell,don't shade cell) thanks a bunch for any help!! Hi this is not possible with formulas as they can only return values but not change formats. The only way would be to use VBA and create an event procedure. e.g. something like the following (this code goes into your worksheet module): Private Sub Worksheet_Change(ByVal Target As Range) If Intersect(Target, Me.Range("A1")) Is Nothing Then Exit Sub With Target If .Value = 10 Then .Interior.ColorIndex = 3 End If End With ...

Target value, Next cell
Hello again. I'm in my worksheet object ,and if the contents of the target cell have a specific value then I would like the cell to the right of the target cell to update with new information. This will happen for multiple rows. Is there a way to do this in the worksheet object without individual line code for each row? Kind regards, D.Parker Target.Offset(0,1).Value = "whatever" -- HTH RP (remove nothere from the email address if mailing direct) "D.Parker" <DParker@discussions.microsoft.com> wrote in message news:7640A4D9-6323-4860-9229-5D8A6...

a Macro to paste a cell from excell to outlook
I am trying to copy and paste a cell ('Name'!C4) into a new email message in microsft outlook. Can a macro be design to integrate the two programs. Thanks. Everything you need for sending mail from Excel can be found at Ron de Bruin's site. http://www.rondebruin.nl/sendmail.htm Gord Dibben MS Excel MVP On Fri, 16 Oct 2009 12:49:02 -0700, murph261 <murph261@discussions.microsoft.com> wrote: >I am trying to copy and paste a cell ('Name'!C4) into a new email message in >microsft outlook. Can a macro be design to integrate the two programs. >Tha...

how do populate empty cells with the contents of populated cells .
I have this worksheet problem. The work sheet is thousands of rows long. One of my columns has cells not populated. I would like to get any empty cell in this column to populate itself with the contents of the next populated cell below it? Kind of a "find and replace" action where by an empty cell says to it self;"I'm going fill myself in with the next thing I find below me" I would greatly appreciate if someone can relate how to do this. Thanks Jim, Select the column, use Edit | Go To... Special , Blanks, OK. Then type an equal sign, press the down arrow...

graph based on the city i select in a particular cell
I have cities and no. of stores in each city. For each store i have 2 data points. Can I have a graph based on a city i select in a drop down cell.. e.g if i select a city A, the graph should display for stores located in City A, if i select City B, the stores of City B get displayed in the chart Plz help Nikhil Hi, Depending on how you data and chart is setup you maybe able to use Autofilter. Select the chart and make sure the option to plot visible cells only is set. Tools > Options > Charts > Plot visible cells only. Cheers Andy -- Andy Pope, Microsoft MVP - Excel htt...