Private Sub CommandButton1_Click()
Dim derligne As Integer
Dim Trouve As Range
With Sheets("BDD")
derligne = .Range("E456541").End(xlUp).Row + 1
If TextBox1 = "" Or TextBox2 = "" Or TextBox3 = "" Or TextBox4 = "" Then MsgBox ("Manque une information"): Exit Sub
Set Trouve = .Range("E:E").Find(TextBox1, lookat:=xlWhole)
If Not Trouve Is Nothing Then
MsgBox ("Référence : " & TextBox1 & " déjà existante")
Else
.Cells(derligne, 5) = TextBox1.Value
.Cells(derligne, 6) = TextBox2.Value
.Cells(derligne, 7) = TextBox3.Value
.Cells(derligne, 8) = TextBox4.Value
End If
End With
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox1.SetFocus
End Sub