Bonjour LouReeD,
Merci pour ton aide, ça fonctionne très bien, suite à tes conseilles sur ton 1er post et après quelque recherche je suis parvenu a un résultat.
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim r As Range
Set r = Sheets("Data_Compatibilité_Produit").Range("B2:C15000").Find(Me.TextBox1.Value, , xlValues, xlWhole)
If Len(TextBox1.Text) = 0 Then
Exit Sub
ElseIf Len(TextBox1.Text) = 10 Then
If Not r Is Nothing Then
Me.Label4.Caption = r.Offset(0, 1).Value
Me.Label4.BackColor = r.Offset(0, 1).Interior.Color
Else
Me.Label4.Caption = ""
TextBox1.Value = ""
MsgBox "Numéro de matériel inconnu", vbExclamation, "PRODUIT AVANT"
Cancel = True
End If
Exit Sub
Else
MsgBox "Il faut 10 chiffres pour le numéro de matériel", vbExclamation, "PRODUIT AVANT"
TextBox1.Value = ""
Cancel = True
Exit Sub
End If
Exit Sub
End Sub
Encore merci pour ton aide et les conseilles.
Bonne journée.