1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| Private Sub Enrgstr_Click()
If Qtité_cmde.Value = "" Then MsgBox ("veuillez entré unne quantité")
Exit Sub
If prix_achat.Value = "" Then MsgBox ("veuillez entré le prix d'achat")
Exit Sub
'enrégistrement des produits comandées
For i = 1 To Derline(1, 1)
If (Nom_prdt.Value = Sheets("PRODUIT").Cells(i + 1, 1)) Then
Sheets("PRODUIT").Cells(i + 1, 4) = Sheets("PRODUIT").Cells(i + 1, 4) + Qtité_cmde.Value
End If
Next i
If (flag = False) Then
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Sheets("PRODUIT").Cells(2, 1) = Nom_prdt.Value
Sheets("PRODUIT").Cells(2, 2) = Type_prdt.Value
Sheets("PRODUIT").Cells(2, 3) = code_prdt.Value
Sheets("PRODUIT").Cells(2, 4) = Qtité_cmde.Value
Sheets("PRODUIT").Cells(2, 6) = prix_achat.Value
Sheets("PRODUIT").Cells(2, 8) = Dat_achat.Value
Sheets("PRODUIT").Cells(2, 9) = Dat_premp.Value
Sheets("PRODUIT").Cells(2, 10) = Nom_grosis.Value
Sheets("PRODUIT").Cells(2, 11) = Adres_gross.Value
End If
Nom_prdt.Value = ""
Type_prdt.Value = ""
code_prdt.Value = ""
Qtité_cmde.Value = ""
prix_achat.Value = ""
Dat_achat.Value = ""
Dat_premp.Value = ""
Nom_grosis.Value = ""
Adres_gross.Value = ""
Rows("2:2").Select
With Selection.Font
.Name = "Calibri"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontMinor
End With
Selection.Font.Bold = False
Selection.Font.Italic = False
End Sub |
Partager