One way:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim vValue As Variant
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(.Cells, Range("A1,A4:A7,J10")) Is Nothing Then
vValue = .Value
If IsNumeric(vValue) Then
Application.EnableEvents = False
With .Offset(0, 1)
.Value = .Value + vValue
End With
Application.EnableEvents = True
End If
End If
End With
End Sub
> I've used:
>
[quoted text clipped - 28 lines]
> > > Do I need to rewrite the whole code for each bit, or can I just add in at
> > > some point through the code?
forevertrying - 08 May 2008 13:54 GMT
I'm really sorry to be a pain
The cell references you've used. What are they? I mean, if you can explain
to me why they are written like that I can sort them out for my worksheet
Thanks
> One way:
>
[quoted text clipped - 47 lines]
> > > > Do I need to rewrite the whole code for each bit, or can I just add in at
> > > > some point through the code?
JE McGimpsey - 08 May 2008 22:11 GMT
The
"A1,A4:A7,J10"
refers to cell A1, cells A4 through A7, and cell J10
I just randomly picked them.
> I'm really sorry to be a pain
>
[quoted text clipped - 21 lines]
> > End With
> > End Sub
forevertrying - 08 May 2008 14:18 GMT
Actually, I figured it out!
Thank you so much for your help!
> One way:
>
[quoted text clipped - 47 lines]
> > > > Do I need to rewrite the whole code for each bit, or can I just add in at
> > > > some point through the code?
forevertrying - 08 May 2008 14:57 GMT
AAAAGGGGGHHHHH!!! ;o)
It just suddenly stopped working. I was trying to protect some of the cells
and then when I went back afterwards, it wouldn't work! Any ideas?
Also, is it possible to protect the cells that are going to retain the
accumulative figure from being deleted? Whatever I did last time clearly
wasn't right.
> One way:
>
[quoted text clipped - 47 lines]
> > > > Do I need to rewrite the whole code for each bit, or can I just add in at
> > > > some point through the code?