Private Sub CommandButton10_Click()
If Me.txt_product.Value = "" Then
MsgBox "attention", vbCritical
Exit Sub
End If
If IsNumeric(Me.txt_price_pru) = False Then
MsgBox "attention svp", vbCritical
Exit Sub
End If
If IsNumeric(Me.txt_price_sale) = False Then
MsgBox "attention svp", vbCritical
Exit Sub
End If
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("product_master")
If Application.WorksheetFunction.CountIf(sh.Range("B:B"), Me.txt_product.Value) > 0 Then
MsgBox "value déjà"""", vbCritical
Exit Sub
End If
Dim lr As Integer
lr = appliction.worksheetfuncion.CountA(sh.Range("A:A"))
sh.Range("A" & lr + 1).Value = lr
sh.Range("B" & lr + 1).Value = Me.txt_product.Value
sh.Range("C" & lr + 1).Value = Me.txt_price_sale.Value
sh.Range("D" & lr + 1).Value = Me.txt_price_pru.Value
Me.txt_product.Value = ""
Me.txt_price_sale.Value = ""
Me.txt_price_pru.Value = ""
MsgBox "Done", vbtnformation