.ColumnCount = 5 'donc 5 colonnes) .ColumnWidths = "80;80;80;80" ' tu n'en dimensionnes ici que 4 .... With ListBox1 .AddItem ("Data") ' donc en colonne 1 For x = 2 To 8 .List(.ListCount - 1, x - 1) = Cells(C.Row, x).Text ' donc en colonne x-1 (= par colonne 7 si x = 8) Next x .List(.ListCount - 1, 8) = C.Address(False, False) ' donc en colonne 8 End With
If C.Offset(0, -1) = ListBox1.list(Lisbox1.listindex) Then
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionvendredi 18 novembre 2011 à 21:38:52
acive
.
..tu utilises les balises quand tu nous envoie du code suffit (troisième icône à partir de droite)
Private Sub ListBox1_Change() i = 0 Me.ListBox2.Clear Set f = Sheets("Data") For Each C In f.Range("B3:B" & f.[B65000].End(xlUp).Row) If C.Offset(0, -1) = Me.ListBox1 Then Me.ListBox2.AddItem Me.ListBox2.List(i, 0) = C.Value Me.ListBox2.List(i, 1) = C.Offset(0, 1).Value Me.ListBox2.List(i, 2) = C.Offset(0, 2).Value Me.ListBox2.List(i, 3) = C.Offset(0, 3).Value Me.ListBox2.List(i, 4) = C.Offset(0, 4).Value Me.ListBox2.List(i, 5) = C.Offset(0, 5).Value Me.ListBox2.List(i, 6) = C.Row i = i + 1 End If Next C End Sub