Count number of times entries are made in a cell
Right click the sheet tab you want this to work in and paste the following
code... It works on the cells in A1:A10. Change that to suit...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim rngChanged As Range
Set rngChanged = Intersect(Target, Range("A1:A10")) 'Change range
If Not rngChanged Is Nothing Then
Application.EnableEvents = False
On Error Resume Next
For Each rng In rngChanged
rng.Offset(0, 1).Value = rng.Offset(0, 1).Value + 1
Next rng
On Error GoTo 0
Application.EnableEvents = True
End If
End Sub
--
HTH...
Jim Thomlinson
" wrote:
Is it possible to count the number of times a cell's content is
changed? For example, if an entry is made in cell A1, then later
deleted and re-entered, is there a macro that will tell me the cell
has had 2 entries total? Thanks for your help.
|