Private Sub TextBox1_Exit(ByVal cancel As MSForms.ReturnBoolean)
ligne = WS.Range("A" & Rows.Count).End(xlUp).Row
Set Rng = WS.Range("A2:G" & ligne)
Set X = Rng.Columns(1).Find(What:=Val(TextBox1), LookAt:=xlWhole)
If Len(TextBox1) < 13 Then
MsgBox ("Vous devez saisir un numéro de code valide." & Chr(10) & Chr(10) & "Pour cela, saisissez 13 chiffres.")
Me.TextBox1 = "": Me.TextBox1.SetFocus
End If
If Not X Is Nothing Then
MsgBox code & " existe déjà!"
cancel = True
End If
End Sub
Private Sub OptModifier_Click()
Me.CmdValider.Caption = "MODIFIER"
Me.CmdValider.BackColor = vbCyan
End Sub