+ Reply to Thread
Results 1 to 5 of 5

How to accumulate total in one cell from another if input changes

  1. #1
    Registered User
    Join Date
    11-01-2014
    Location
    New Zealand
    MS-Off Ver
    dffe
    Posts
    2

    How to accumulate total in one cell from another if input changes

    Hi,

    I am trying to create a roulette excel game.

    I have a cell with how much I want to bet and if I win then money is added to a cell, if I lose money is taken away.

    So basically I have cell B8 which is where I enter how much money total I want use during the game, but not bet total, there will be other cells where I enter how much of that total I want to bet.

    I then have a cell C8 which shows how much I won and adds that to cell D8. This cell D8 is what I want to accumulate. Im guessing I need a macro of some sorts.

    I have use the below macro:
    Please Login or Register  to view this content.
    This works if I manually put a value in C8 but if I put a formula it does not work:
    Please Login or Register  to view this content.
    when E11=C3 it shows in cell C8 but does not accumulate.

    Any advice?

    Thanks
    Last edited by gigaplatinum; 11-01-2014 at 04:50 AM.

  2. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: How to accumulate total in one cell from another if input changes

    I have a suggestion for you..
    I think you should trigger your code to the cell which you change last.. ( I mean in which you enter the amount,
    expect result. )
    Please Login or Register  to view this content.

    Regards,
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to accumulate total in one cell from another if input changes

    Hi, gigaplatinum,

    please have a look at Forum Rule#3 to understand why you are asked to apply code-tags to your procedure.

    Besides you are using the wrong event or the wrong area to view at in order to get the result.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    11-01-2014
    Location
    New Zealand
    MS-Off Ver
    dffe
    Posts
    2

    Re: How to accumulate total in one cell from another if input changes

    Quote Originally Posted by Vikas_Gautam View Post
    I have a suggestion for you..
    I think you should trigger your code to the cell which you change last.. ( I mean in which you enter the amount,
    expect result. )
    Please Login or Register  to view this content.

    Regards,
    Not sure what you mean by trigger. How do I go about that?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,487

    Re: How to accumulate total in one cell from another if input changes

    A worksheet change event only fires (is triggered, or executed) when a manual change is made to a cell, or a cell is changed using code. It does NOT fire when a formula result changes.

    So, instead of monitoring the cell with the formula, you need to monitor the cells it depends upon (it's precedents).


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Replies: 1
    Last Post: 02-10-2014, 11:42 PM
  2. Accumulate a value into one cell if...
    By lovethepirk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-16-2012, 11:33 AM
  3. A running total using one input cell
    By threedeesix in forum Excel General
    Replies: 2
    Last Post: 02-25-2007, 02:29 AM
  4. [SOLVED] Macro to input total copies from a cell value
    By Vic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2006, 06:05 AM
  5. [SOLVED] Accumulate weekly time to total time in Excel.
    By delve in forum Excel General
    Replies: 0
    Last Post: 05-04-2005, 04:06 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