this is code is work great! but I dont know what they are mean
for someday I apply it to other work.
for someday I apply it to other work.
VBA Code:
Dim r As Range
Dim c As Boolean
Private Sub worksheet_calculate()
' Dim Target As Range
' Set Target = Range("A1")
If c = False Then
c = True
Exit Sub
End If
If r.Count > 1 Then Exit Sub
Application.EnableEvents = False
If Not Intersect(r, Me.[k1:k16]) Is Nothing Then
If r.Value = 0 Then
Me.Cells(r.Row, "c").Value = Me.Cells(r.Row, "c").Value + 1
End If
End If
c = False
Application.EnableEvents = True
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If c = False Then Exit Sub
Set r = Target
c = True
r.Value = r.Value
End Sub