Bonjour,
je souhaite récupérer les valeurs d'une listbox dans une autre listbox.
Voici mon code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
With usf_Dot
.tbRefArt = LstLigDot.List(LstLigDot.ListIndex, 0) ' ref Article
.tbDesignation = LstLigDot.List(LstLigDot.ListIndex, 1) ' Designation
.tbPdt = LstLigDot.List(LstLigDot.ListIndex, 2) ' Produit
.tbStatutReglementaire = LstLigDot.List(LstLigDot.ListIndex, 3) 'Statut règlementaire
.tbListePositive = LstLigDot.List(LstLigDot.ListIndex, 4) 'Liste positive
.tbUnitecde = LstLigDot.List(LstLigDot.ListIndex, 5) ' Unite cde
.tbStockStaci = LstLigDot.List(LstLigDot.ListIndex, 6) ' Stock
.tbPoids = LstLigDot.List(LstLigDot.ListIndex, 7) ' Poids
' .tbdatePeremption = LstLigDot.List(LstLigDot.ListIndex, 19) ' Date peremption
'on récupère le nombre de lignes "réseau" présents dans la listbox LstLignesSel
x = LstLignesSel.ListCount
For i = 1 To x
'Rajout d'une colonne
LstLignesSel.ColumnCount = 2
' Récupération des valeurs présentes à partir de la colonne 11 + x
LstLignesSel.AddItem
LstLignesSel.List(i, 1) = LstLigDot.List(LstLigDot.ListIndex, i + 10)
Next i
End With |
Mon code plante à la ligne
LstLignesSel.List(i, 1) = LstLigDot.List(LstLigDot.ListIndex, i + 10)
avec l'erreur 
Est-ce que quelqu'un voit quel peut être le problème?
Merci d'avance,
Frank
Partager