Keep a running total in a single cell

  • Hey guys,
    I am working on a sheet where I am trying to keep a running total in a single cell. The VBA code that I am using works, but it only works if I type a value in the cell. I need it to work when the value is based on a formula, not a value. Any suggestions? Here is the code that I am currently using.


  • Re: Keep a running total in a single cell


    Code
    Range("h7").value = Range("h7").value + target


    code not tested, try adding .value at the back of every range.

  • Re: Keep a running total in a single cell


    Hi, basshunter514,


    in case of a formula you must either relate in the cells in which the entries are made directly or to the Calculate-event to catch if any new calculation in a range has been made. This might require a volatile function in the sheet as well.


    Ciao,
    Holger

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!