Cell count

hockey_pro Posts 1 Registration date Thursday June 11, 2009 Status Member Last seen June 13, 2009 - Jun 13, 2009 at 03:51 PM
 venkat1926 - Jun 14, 2009 at 09:08 PM
i am trying to use microsoift office excel and trying to count in a count cell.. like adding numbers together that i add into that certain cell as per example: i have 5 in cell b1 i reenter in b1 2 push enter and it will show now 7 (5+2) if someone can help me please

1 response

I do not know whether you can enter number in a cell to add to the previous entry. you can do one trick
suppose b1=5
riight click sheet tab and click view code and copy paste this code

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo line1
If Target.Address <> "a1" Then
Range("b1") = Target + Range("b1")
End If
Application.EnableEvents = True
End Sub

now enter any number to A1 and see what happens to B1
again enter another no. in A1 and see what happens B1
post feedback