1 2 3 4 5 6 7 8 9 10 11 12 13
| Private Sub CommandButton1_Click()
Dim Quantite As Integer
Dim i As Integer
Quantite = InputBox("entrez la quantité nécessaire ", "Quantité ingrédient")
For i = 0 To ListBox3.ListCount - 1 ' listCount -1 est le dernier
If ListBox3.Selected(i) Then
ListBox4.AddItem (i + 7) & " // " & Quantite
Workbooks("Gestion_Alimentaire").Worksheets("A_Vous_de_Jouer").Range("B2").Value = i + 7
Workbooks("Gestion_Alimentaire").Worksheets("A_Vous_de_Jouer").Range("C2").Value = Quantité
End If
Next i
End Sub |