View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
shrtdawg73 shrtdawg73 is offline
external usenet poster
 
Posts: 5
Default keeping a running total in a single cell

Don, again thanks for your help, but I'm having a little trouble following
what you put. When I right click the sheet tab (at the bottom of the page)
and select insert, it comes up with a general tab and a spreadsheet solutions
tab. Does the formula that you wrote below start Option Explicit???? Is
there a formula that I can just assign to that specific cell......sorry if
this doesn't make sense.

"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?