Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cellule As Range
If Not Application.Intersect(Range("D5:D500"), Target) Is Nothing Then
For Each Cellule In Application.Intersect(Range("D5:D500"), Target)
If Cellule.Comment Is Nothing Then
If Cellule.Text <> "" Then
Cellule.AddComment Cellule.Value & " " & Environ("username") & " " & Format(Now, "DD/MM/YYYY HH:MM:SS")
End If
Else
If Cellule.Value = 0 Then
If Cellule.Text = "" Then
Cellule.Comment.Delete
Else
Cellule.Comment.Text Text:=Cellule.Value & " " & Environ("username") & " " & Format(Now, "DD/MM/YYYY HH:MM:SS")
End If
Else
Cellule.Comment.Text Text:=Cellule.Comment.Text & Chr(10) & Cellule.Value & " " & Environ("username") & " " & Format(Now, "DD/MM/YYYY HH:MM:SS")
End If
End If
On Error Resume Next
Cellule.Comment.Shape.TextFrame.AutoSize = True
On Error GoTo 0
Next Cellule
End If
End Sub