1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Private Sub UserForm_Initialize()
Init
End Sub
Sub Init()
Dim ListCol As Variant, NoCol
Dim ListLig As Variant, NoLig
ListCol = Array(1, 4, 6) 'liste des colonnes ds la feuille de calculs
ListLig = Array(2, 5, 7, 9) 'Liste des lignes
'On crée les lignes en remplissant la première colonne
For NoLig = 0 To UBound(ListLig)
Me.ListBox1.AddItem Cells(ListLig(NoLig), ListCol(0)).Value
Next
'On remplit les autres colonnes
For NoCol = 1 To UBound(ListCol)
For NoLig = 0 To UBound(ListLig)
Me.ListBox1.Column(NoCol, NoLig) = _
Cells(ListLig(NoLig), ListCol(NoCol)).Value
Next
Next
End Sub |
Partager