Posted to microsoft.public.excel.worksheet.functions
|
|
keeping a running total in a single cell
thanks for the reply
"Duke Carey" wrote:
While Don's approach can solve your problem, keep in mind that you lose any
kind of audit trail. If you miskey a number, your running total is hosed and
there is nothing you can do but start all over. Matter of fact, even if you
DON'T miskey a number, you hav no way of validating that the running total is
correct.
In other words, what you want to accomplish isn't a recommended way of working
"Don Guillett" wrote:
right click sheet tabinsert thisSAVE now in cell a5 you can add it up
Option Explicit
Dim oldvalue As Double
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$5" Then
On Error GoTo fixit
Application.EnableEvents = False
If Target.Value = 0 Then oldvalue = 0
Target.Value = 1 * Target.Value + oldvalue
oldvalue = Target.Value
fixit:
Application.EnableEvents = True
End If
End Sub
--
Don Guillett
SalesAid Software
"shrtdawg73" wrote in message
...
Is it possible to have numbers added to the same cell and have excel
continue
to calculate the addition for me in that same cell......ex: I have the
number
8 in cell d2 and I want to add the number 8 to that cell and have excel
add
the 8 to the previous 8 for a total of 16 in the same cell.....the next
time
I would add 5, and the total would be 21? Can this be done in a single
cell?
|