Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Dim t$, Lig&
With TextBox1
If Len(.Value) = 4 Then KeyAscii = 0: Exit Sub
t = Mid(.Value & Chr(KeyAscii), 1, 5)
If Len(t) = 4 Then
With Application: Lig = .IfError(.Match(Val(t), Feuil2.[B:B], 0), 0): End With
If Lig = 0 Then
MsgBox "CE NUMERO N'EXISTE PAS", vbExclamation, "A CHANGER": t = ""
End If
End If
.Value = t
KeyAscii = 0
End With
End Sub