Re-
Excuse moi, je m'exprime mal.
Chaque fois que j'interviens dans une cellule de la feuille 4 (formulaire 3), l'évênement est enregistré dans un commentaire, et ce pour toutes les cellules de la feuille. Je voudrais que cet enregistrement ne se fasse que dans certaines cellules (ex : B24, D16)
Le code est le suivant :
Private Sub Worksheet_Change(ByVal Target As Range)
Dim OldComment As String, NewComment As String, objCell As Range
If Target.Cells.Count > 1 Then Exit Sub
NewComment = Target.Value & " Modifié le " & Now() & " par " & Application.UserName
If Target.Comment Is Nothing Then
Target.AddComment NewComment
Else
OldComment = Target.Comment.Text
Target.Comment.Text NewComment & vbLf & OldComment
End If
Target.Comment.Shape.TextFrame.AutoSize = True
Target.Comment.Visible = False
End Sub
Merci,
Cdlt,