'--Validation dans feuil Produit
Private Sub CommandButton3_Click()
Dim Derlgn As Integer
With Sheets("Produits")
Derlgn = .Range("A2:U65536").End(xlUp).Row + 1
.Cells(Derlgn, 1) = Derlgn '- ligne de départ pour
.Cells(Derlgn, 1) = ComboBox1.Value
.Cells(Derlgn, 2) = TextBox1.Value 'Nom Produit
.Cells(Derlgn, 3) = TextBox2.Value 'Unité
.Cells(Derlgn, 5) = Format(TextBox4.Value, "dd mm yyyy") 'Date entrée en stock '
.Cells(Derlgn, 6) = Format(TextBox5.Value, "0000") 'Quantité entrée
'.Cells(Derlgn, 7) = Format(TextBox19.Value, "# ##0.00 €") 'Prix achat HT
If TextBox19 <> "" Then .Cells(Derlgn, 7) = CDbl(TextBox19) 'Prix achat HT
.Cells(Derlgn, 8) = TextBox6.Value 'Taux TVA
If TextBox7 <> "" Then .Cells(Derlgn, 9) = CDbl(TextBox7) 'Prix achat HT
If TextBox8 <> "" Then .Cells(Derlgn, 10) = CDbl(TextBox8) 'Prix achat HT
.Cells(Derlgn, 11) = Format(TextBox9.Value, "0000") 'réf produit
.Cells(Derlgn, 12) = Format(TextBox10.Value, "0000") 'code client
.Cells(Derlgn, 13) = TextBox11.Value '% remise fournisseur
.Cells(Derlgn, 14) = TextBox12.Value 'marge a réaliser
If TextBox13 <> "" Then .Cells(Derlgn, 15) = CDbl(TextBox13) 'Prix achat HT
.Cells(Derlgn, 16) = TextBox14.Value 'taux tva sur prix vente
If TextBox15 <> "" Then .Cells(Derlgn, 17) = CDbl(TextBox15) 'Prix achat HT
If TextBox16 <> "" Then .Cells(Derlgn, 18) = CDbl(TextBox16) 'Prix achat HT
.Cells(Derlgn, 19) = TextBox17.Value 'remise a accorder
If TextBox18 <> "" Then .Cells(Derlgn, 20) = CDbl(TextBox18) 'Prix achat HT
.Cells(Derlgn, 21) = Format(TextBox20.Value, "0000") 'quantité mini a commander
End With
End Sub