Bonsoir
Code à placer à la place de l'autre
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Lg As Long
Dim Coul As Byte
If Target.Column = 2 And Target.Count = 1 Then
If Target.Comment Is Nothing Then Target.AddComment ' Création commentaire
Target.Comment.Text Text:=Target.Comment.Text & _
Target.Value & " Modifié par:" & Environ("UserName") & _
" Le " & Now & vbLf
Target.Comment.Shape.TextFrame.AutoSize = True
If Range("D1") = "" Then
Lg = 1
Coul = 3
Else
Lg = Range("D" & Rows.Count).End(xlUp).Row
Coul = Range("E" & Lg).Interior.ColorIndex
If Range("E" & Lg) < Range("F1") Then ' Mets en commentaire cette ligne
' If Range("E" & Lg) < Date Then ' Enlèves le commentaire à cette ligne
Coul = Coul + 1
If Coul = 57 Then Coul = 3
Lg = Lg + 1
End If
End If
Range("D" & Lg) = "Date de la dernière modification"
With Range("E" & Lg)
.NumberFormat = "m/d/yyyy"
.Interior.ColorIndex = Coul
.Value = Range("F1") ' Mets en commentaire cette ligne
' .Value = Date ' Enlèves le commentaire à cette ligne
End With
Target.Interior.ColorIndex = Coul
End If
End Sub