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
| Private Sub Enrgstr_Click()
Dim FLAG As Boolean
For i = 1 To Derline(1, 1)
If (Nom_prdt.Value <> Sheets("PRODUIT").Cells(i + 1, 1)) Then
exit sub
else
Sheets("PRODUIT").Cells(i + 1, 4) = Sheets("PRODUIT").Cells(i + 1, 4) + Qtité_cmde.Value
Sheets("PRODUIT").Cells(i + 1, 5) = Sheets("PRODUIT").Cells(i + 1, 5) + 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
end sub |
Partager