Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$13" And Target.Count = 1 Then
On Error Resume Next
Set temp = Sheets("listes").Range("LesNoms").Find(what:=Target.Value, LookAt:=xlWhole)
If Err = 0 Then
On Error GoTo 0
Set temp = Sheets("listes").Range("LesNoms").Find(what:=Target.Value, LookAt:=xlWhole)
If temp Is Nothing Then Exit Sub
p = InStr(Target.Offset(0, 2), Target.Value & ":")
If p > 0 Then
Target.Offset(0, 2) = Left(Target.Offset(0, 2), p - 1) & _
Mid(Target.Offset(0, 2), p + Len(Target.Value) + 1)
Else
Target.Offset(0, 2) = Target.Offset(0, 2) & Target.Value & ":"
End If
Application.EnableEvents = False
Target = Empty
Application.EnableEvents = True
End If
End If
If Target.Address = "$B$14" And Target.Count = 1 Then
On Error Resume Next
Set temp = Sheets("listes").Range("Autres").Find(what:=Target.Value, LookAt:=xlWhole)
If Err = 0 Then
On Error GoTo 0
Set temp = Sheets("listes").Range("Autres").Find(what:=Target.Value, LookAt:=xlWhole)
If temp Is Nothing Then Exit Sub
p = InStr(Target.Offset(0, 2), Target.Value & ":")
If p > 0 Then
Target.Offset(0, 2) = Left(Target.Offset(0, 2), p - 1) & _
Mid(Target.Offset(0, 2), p + Len(Target.Value) + 1)
Else
Target.Offset(0, 2) = Target.Offset(0, 2) & Target.Value & ":"
End If
Application.EnableEvents = False
Target = Empty
Application.EnableEvents = True
End If
End If
End Sub