Sub Alimente_ListViewFleurs()
'
With Magasin.ListView_List_Fleurs
.ListItems.Clear
.Gridlines = True
.View = lvwReport
.FullRowSelect = True
.AllowColumnReorder = True
With .ColumnHeaders
.Clear
.Add Text:="Catégorie", Width:=0
.Add Text:="Nom", Width:=120
.Add Text:="Couleur", Width:=100
.Add Text:="Type Bouton", Width:=80
.Add Text:="Prix/Botte", Width:=80
.Add Text:="Nbre Tige/Botte", Width:=80
.Add Text:="PU/Tige", Width:=80
.Add Text:="Fournisseurs", Width:=100
End With
End With
AjoutTableauDansListview ("Tbl_List_Roses")
AjoutTableauDansListview ("Tbl_List_Oeillets")
AjoutTableauDansListview ("Tbl_Divers_Fleurs")
AjoutTableauDansListview ("Tableau39")
End Sub
Sub AjoutTableauDansListview(NomTableau As String)
' Remplissage de la ListView avec le tableau
Dim MaxRow As Long, MyRow As Long, MaxCol As Long, MyCol As Long, NbRow As Long
With Magasin.ListView_List_Fleurs
NbRow = .ListItems.Count
MaxRow = IIf(Range(NomTableau).ListObject.DataBodyRange Is Nothing, 0, Range(NomTableau).ListObject.ListRows.Count)
MaxCol = Range(NomTableau).ListObject.ListColumns.Count
For MyRow = 1 To MaxRow
.ListItems.Add
For MyCol = 2 To MaxCol
.ListItems(MyRow + NbRow).ListSubItems.Add Text:=Range(NomTableau).Cells(MyRow, MyCol).Value
Next MyCol
Next MyRow
End With
End Sub