Excel

G

Glenn Robertsoon

Hi,
Is it possible to put a formula in a cell that will add up
values put in the same cell.

e.g. I have a long list of values that need inputting
Is it possible that somebody could put a value in cell a1
and enter then another value in the same cell and then
enter another value in the same cell and then have another
cell that will add up all the values put in that cell.
 
D

Don Guillett

right click sheet tab>view code>insert this. Use 0 to start over.

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
 

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

Top