Private Sub MajInventaire()
Dim v As Integer
With Worksheets("Inventaire")
lgD = .Cells(Rows.Count, 1).End(xlUp).Row + 1
For v = 0 To ListBox1.ListCount - 1
With .Cells(lgD, 3)
If flgAdd = 0 Then
.Offset(, -2) = ListBox1.List(v, 1) 'Code article
.Offset(, -1) = ListBox1.List(v, 4) 'Catégorie
.Offset(, 2) = ListBox1.List(v, 5) 'Seuil d'alerte
.Offset(, 3) = ListBox1.List(v, 6) 'Descriptif
.Offset(, 4) = ListBox1.List(v, 7) 'Référence
.Offset(, 5) = ListBox1.List(v, 8) 'Unité de mesure
.Offset(, 6) = "Transfert" 'Observations
.Offset(, 9) = ComboBox2 'Magasin
QD = Val(.Value) + QT: .Value = QD 'Stock actuel
Else
.Offset(, 7) = .Offset(, 7) + ListBox1.List(v, 9)
End If
lgT = lgT + 1
End With
.Protect
Next v
End With
End Sub
Private Sub ListBox1_afterupdate()
Me.TextBox1.Value = Me.ListBox1.Column(0)
Me.CB_Pièce.Value = Me.ListBox1.Column(1)
Me.catetr = Me.ListBox1.Column(2)
Me.Desitr = Me.ListBox1.Column(3)
Me.reftr = Me.ListBox1.Column(4)
Me.unitr = Me.ListBox1.Column(5)
Me.seuil = Me.ListBox1.Column(6)
Me.TextBox81 = Me.ListBox1.Column(7)
Me.TextBox85.Value = Me.ListBox1.Column(9)
Me.Quantitetr.Value = Me.ListBox1.Column(8)
'Me.TextBox81.Value = Me.ListBox1.Column(10)
End Sub