Private Sub Worksheet_Change(ByVal Target As Range)
Dim xcell As Range, NomCherche, s As String
'pas dans données de la colonne A => on ne fait rien
If Intersect(Target(1, 1), Range(Range("A1"), Range("A" & Rows.Count).End(xlUp))) Is Nothing Then Exit Sub
NomCherche = Target.Value
' si target a ou n'a pas de commentaire associé => on le modifie ou le crée
If Target(1, 1).Comment Is Nothing Then Target(1, 1).AddComment "\\\\" _
Else Target(1, 1).Comment.Text "////" & Target(1, 1).Comment.Text
'tri
ActiveSheet.Range([A2], [A2].End(xlDown).Offset(0, 10)).Sort Key1:=[A2], Key1:=[B2]
'boucle sur les cellules avec commentaires de la colonne A
For Each xcell In Range("A:A").SpecialCells(xlCellTypeComments)
s = xcell.Comment.Text
If Left(s, 4) = "\\\\" Then
'le commentaire de Target a été créé par cette proc => on le supprime
xcell.ClearComments
'sélection de target et on sort
xcell.Select: Exit For
ElseIf Left(s, 4) = "////" Then
'le commentaire de Target existait => on le restaure
xcell.ClearComments: xcell.AddComment Text:=Mid(s, 5)
'sélection de target et on sort
xcell.Select: Exit For
End If
Next xcell
End Sub