Bonsoir,

je veux mettre des valeurs dans un tableau puis le mettre dans un listbox

voici le code utilisé :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Dim MyArray(30, 5)
Dim i As Single
 
ListBox1.ColumnCount = 5
 
Windows("Revue Referentiel.xls").Activate
Sheets("Nomenclature Equipement").Select
Nligne = Cells(1, 1).CurrentRegion.Rows.Count
Z = 0
MyArray(0, 1) = "Fonctionnalité"
MyArray(0, 2) = "Article Fils"
MyArray(0, 3) = "Description"
MyArray(0, 4) = "Quantité"
 
For x = 1 To Nligne
    If Cells(x, 1) = ArtRech Then
        Z = Z + 1
        MyArray(Z, 1) = Cells(x, 2)
        MyArray(Z, 2) = Cells(x, 3)
        MyArray(Z, 3) = Cells(x, 4)
        MyArray(Z, 4) = Cells(x, 5)
    End If
Next x
ListBox1.List() = MyArray
Comment modifier chaque colonne de mon tableau dans la listbox ?

Merci d'avance