Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Len(TextBox1) < 3 Then Exit Sub
Dim x$, t, y
x = Right(TextBox1, 3)
t = Range("A1", Range("A" & Rows.Count).End(xlUp)(2))
For Each y In t
If Left(y, 3) = x Then
MsgBox "Pas autorisé !", 48, "Erreur"
TextBox1 = ""
Cancel = True
Exit For
End If
Next
End Sub