AJOUT MACRO HISTORIQUE MODIFICATION CELLULE ( origine boisgontier )

urbanito1

XLDnaute Occasionnel
bonsoir le forum,

ma sollicitation fait suite à la création d'un userform

https://www.excel-downloads.com/threads/userform-debutant-creation.200608/

je viens d'ajouter le code historique sur la feuille 1

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 3 Or Target.Column = 4 Or Target.Column = 5 Or Target.Column = 6 Or Target.Column = 7 Then
On Error Resume Next ' active la gestion d'erreur
Err = 0
temp = Target.Comment.Text ' Commentaire existe t-il?
If Err <> 0 Then Target.AddComment ' Création commentaire
Target.Comment.Text Text:=Target.Comment.Text & _
Target.Value & " Modifié par:" & NomUtil() & _
" Le " & Now & vbLf
Target.Comment.Visible = True
Target.Comment.Shape.Select
Selection.AutoSize = True
Target.Comment.Visible = False
On Error GoTo 0 ' désactive la gestion d'erreurs
End If
Application.EnableEvents = True
End Sub

ca fonctionne

étant loin d'être un initié, je voudrais simplement avoir un avis...

est-ce bien ainsi qu'il fallait procéder?

merci bien

urbanito
 

Pièces jointes

  • Copie de ENCODAGE -PER VERSION 3 2 2013 - jean marcel 3 2 2013.xlsm
    37.8 KB · Affichages: 40
  • Copie de ENCODAGE -PER VERSION 3 2 2013 - jean marcel 3 2 2013.xlsm
    37.8 KB · Affichages: 51
  • Copie de ENCODAGE -PER VERSION 3 2 2013 - jean marcel 3 2 2013.xlsm
    37.8 KB · Affichages: 50

Discussions similaires

Statistiques des forums

Discussions
312 166
Messages
2 085 890
Membres
103 019
dernier inscrit
Eliot_1