Circular Reference Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I can not seem to solve this problem. I have a simple worksheet that I need to design. All is well except this problem. I have a cell that is blank. I want to input a number in a different cell ( 5) and have it added to the first cell (now 5). I get this but the problem is tomorrow I want to enter a new number (2) in the second cell and have it added to the new total from yesterday (5) to create a new total (7).
Basically what I want is a running total in the first cell that increases by the a new number input in the second cell. Something like the memory process on a calculator where you hit the M+ key to add the amount displayed to the amount already in memory
Every solution I have tried causes a circular reference
Any suggestions
Thank you

Gary T.
 
Hi

The only way to do this is by macro, or using worksheet's Change event. But
you must be aware that there'll be no Undo feature available - it'll be very
easy to mess up with your summing accidentally. And with Change event I'm
not sure what happens, when you activate edit mode for your input cell by
accident, and then leave it using Enter or Tab - probably the old value is
added anew.


--
(When sending e-mail, use address (e-mail address removed))
Arvi Laanemets


Gary T. said:
I can not seem to solve this problem. I have a simple worksheet that I
need to design. All is well except this problem. I have a cell that is
blank. I want to input a number in a different cell ( 5) and have it added
to the first cell (now 5). I get this but the problem is tomorrow I want to
enter a new number (2) in the second cell and have it added to the new total
from yesterday (5) to create a new total (7).
Basically what I want is a running total in the first cell that increases
by the a new number input in the second cell. Something like the memory
process on a calculator where you hit the M+ key to add the amount displayed
to the amount already in memory.
 
Gar

You've answered your own question. Put a button on the sheet and treat it as a 'M+' button on a calculator - sample shown below. You could also add to it, for example: to make sure it didn't get pushed more than once per day without confirmation couldn't be changed by the user, etc

Re

In this example the button was called 'Addit' and the code was added to the click event by inserting the button from the forms toolbar, right clicking to change name property then clicking on 'show code' (either on right click menu or forms toolbar)

The cells are referenced as (rowindex, colindex) so cells(2,1) is a2 and cells(2,3) is c3, etc

Private Sub ADDIT_Click(
sheet1.Activat
sheet1.Cells(2, 1).Value = sheet1.Cells(2, 3) + sheet1.Cells(2, 1
sheet1.ceels(2,3).value =
sheet1.Calculat
End Su
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top