1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Private Sub UserForm_Initialize()
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , "Référence", ListView1.Width * 0.2
ListView1.ColumnHeaders.Add , , "Désignation", ListView1.Width * 0.4
ListView1.ColumnHeaders.Add , , "Prix public", ListView1.Width * 0.2
ListView1.ColumnHeaders.Add , , "Valeur Stock Totale", ListView1.Width * 0.2
Dim iLigArticle As Integer
iLigArticle = 2
ListView1.ListItems.Clear
While Workbooks("STOCK1.xls").Sheets("STOCK").Cells(iLigArticle, 1) <> ""
ListView1.ListItems.Add iLigArticle - 1, , Sheets("STOCK").Cells(iLigArticle, 1)
ListView1.ListItems(iLigArticle - 1).SubItems(1) = Sheets("STOCK").Cells(iLigArticle, 3)
ListView1.ListItems(iLigArticle - 1).SubItems(2) = Format(Sheets("STOCK").Cells(iLigArticle, 4), "## ##0.00 ")
ListView1.ListItems(iLigArticle - 1).SubItems(3) = Format(Sheets("STOCK").Cells(iLigArticle, 6), "## ##0.00 ")
iLigArticle = iLigArticle + 1
Wend
TextBoxValeurTotaleStock = Format(Sheets("STOCK").Range("g2").Value, "## ##0.00 ")
End Sub |
Partager