urbanito1
XLDnaute Occasionnel
Bonjour à la communauté,
j'ai un fichier excel avec 10 feuilles
la première feuille contient la macro historique ( je l'ai trouvée sur le site )
je voudrais insérer à la feuille 10 ( liste 9 ) cette macro ( origine Boisgontier)
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 21 Or Target.Column = 24 Or Target.Column = 28 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
Je n'y arrive pas,
qui peut me montrer
merci bien
urbanito
j'ai un fichier excel avec 10 feuilles
la première feuille contient la macro historique ( je l'ai trouvée sur le site )
je voudrais insérer à la feuille 10 ( liste 9 ) cette macro ( origine Boisgontier)
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
If Target.Column = 2 Or Target.Column = 4 Or Target.Column = 6 Or Target.Column = 21 Or Target.Column = 24 Or Target.Column = 28 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
Je n'y arrive pas,
qui peut me montrer
merci bien
urbanito