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
| Private Sub CommandButton1_Click()
Dim nom As String
Dim prod_a_entrer As String
Dim stock_actuel As String
Dim stock_actuel2 As Integer
L = 2
K = Worksheets("BasedeDonnees").Range("A65536").End(xlUp).Row
If ComboBox1.Value <> "" And SpinButton1.Value <> 0 Then
Sheets("basededonnees").Unprotect
Worksheets("BasedeDonnees").Activate
nom = ComboBox1.Value
For L = 2 To K
If Worksheets("BasedeDonnees").Cells(L, 3).Value = nom Then
stock_actuel = Worksheets("BasedeDonnees").Cells(L, 10).Value
prod_a_entrer = Label7.Caption
stock_actuel2 = stock_actuel + prod_a_entrer
Worksheets("BasedeDonnees").Cells(L, 10).Value = stock_actuel2
MsgBox (" Vous avez rentré " & prod_a_entrer & " article(s) " & nom & " dans le stock")
Unload Entreearticle
MenuGeneral.Show
End If
Next
Sheets("basededonnees").Protect
End If
End Sub |
Partager