+ Reply to Thread
Results 1 to 6 of 6

Keeping a Total to Update with each new entry

  1. #1
    Registered User
    Join Date
    06-16-2014
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    4

    Keeping a Total to Update with each new entry

    So I am trying to use a spreadsheet to maintain a count of each item in a storage room. I have an item name in cell A5 and in E5 I have how many were counted. Now I want to be able to add and/or subtract from that number as new product is added or subtracted from the room. I have created a drop-down cell in F5 so that I can just choose the value we are adding and the total will update.

    My issue is that the total "forgets" the old number in the drop down as soon as I change it and the value is off. Is there a way to make it so that if I have "5" in cell E5 and add "5" from the drop down in F5, the total will say 10; AND THEN, I can choose "5" from the drop down again and the total will be "15"? I would also like to have a subtraction cell in G5 for when things are removed. Thanks guys, hope you can help, it's really been kicking my ***.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Keeping a Total to Update with each new entry

    You'll need VBA to do this because, as you said, the formulas do not have any memory of what came before. I am assuming that it won't just be in row 5 so I set up this code for 5:100. Adjust to fit your ranges. Right click on the sheet tab > View code and paste this code in.
    I am attaching an example sheet also.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-16-2014
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Keeping a Total to Update with each new entry

    So your code works, however it's just a bit different than my goal; I believe I explained it poorly. It seems to be placing the "total" into E5. That is actually already populated with a constant number. F5 and G5 are the addition/subtraction respectively, and H5 would be the total. Also, should I have to skip a range for a new group of items, how would I go about doing that? Is it as simple as adding an additional range to the code, or would I have to have a new set of code for each new range? I've attached an example of what I'm looking at doing. Thanks!
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Keeping a Total to Update with each new entry

    The Offset part of the code is (rows, columns) so for F to H is (0,2) and for G to H is (0,1)
    Yes, should just be able to add code ofr the additional ranges, your example didn't exactly show where or how these ranges would differ so couldn't give you an example.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-16-2014
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Keeping a Total to Update with each new entry

    I don't suppose you could tell me how to mark this as solved? I can't find the edit first post selection.

  6. #6
    Registered User
    Join Date
    06-16-2014
    Location
    Maryland, USA
    MS-Off Ver
    2010
    Posts
    4

    Re: Keeping a Total to Update with each new entry

    Got it thanks for all your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. keeping a bank total
    By grentech in forum Excel General
    Replies: 2
    Last Post: 09-30-2010, 10:13 PM
  2. [SOLVED] KEEPING THE TOTAL IN C3 WHEN ADDING B3
    By bouncer8 in forum Excel General
    Replies: 3
    Last Post: 08-18-2006, 08:25 PM
  3. [SOLVED] Keeping an acculumative total in a row and only that row.
    By Sherry in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2006, 04:40 PM
  4. Keeping a running total
    By Simbo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2005, 03:55 PM
  5. Keeping a running total
    By Simbo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-12-2005, 03:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1