"default" calculation

  • Thread starter Thread starter mika.
  • Start date Start date
M

mika.

A1= sub-total 1
A2= sub-total 2
A3=total; that is, sum(A1,A2)
.....but in case I want to manually enter A3 (i.e. because
there is another additional cost for some reason), I want
the user to have that option.
However, if the user presses delete on A3, or starts
typing something but then backspaces and presses return
but then does not enter any new data (perhaps because they
realize that they just want to use the formula), rather
than have the formula deleted and being left with a
completely blank cell, i woud like the formula to
recaculate and have that calculated value appear in A3.

Does anyone know how I might do this?

Thanks!
 
You would have to implement some VBA code in a Worksheet_Change event macro that restores the
formula after-the-fact if the user leaves cell A3 blank.
 
Mika,

One way would be to use VBA and the excel worksheet
change event. Of course this would run code everytime
you changed anything on the sheet. Repost if you'd like
help with this.

Another way would be to add an override cell
ie in cell B2 put Override Calc
make it obvious that B3 is the entry cell (colors, borders...)
in cell A2 put the formula
=IF(B3="", SUM(A1,A2), B3)

Dan E
 
Back
Top