Private Sub TextBox2_AfterUpdate()
Dim n As Long
If OptionButton1 = True Then
For n = 3 To 65536
If TextBox2.Value = Sheets("agent").Range("B" & n).Value Then
MsgBox "Ce nom existe déjà dans la liste Simples Agents!", , "ATTENTION !"
With TextBox2
.Value = ""
.SetFocus
End With
Exit Sub
End If
Next n
End If
If OptionButton2 = True Then
For n = 3 To 65536
If TextBox2.Value = Sheets("instructeur").Range("B" & n).Value Then
MsgBox "Ce nom existe déjà dans la liste Agents Instructeurs!", , "ATTENTION !"
With TextBox2
.Value = ""
.SetFocus
End With
Exit Sub
End If
Next n
End If
End Sub