1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Private Sub ComboBox1_Change()
i = 0
Me.ListBox1.Clear
For Each c In Range([A2], [A65000].End(xlUp))
If c.Offset(0, 2) = Me.ComboBox1 Or Me.ComboBox1 = "*" Then
Me.ListBox1.AddItem
Me.ListBox1.List(i, 0) = c.Value
Me.ListBox1.List(i, 1) = c.Offset(0, 1).Value
Me.ListBox1.List(i, 2) = c.Offset(0, 2).Value
Me.ListBox1.List(i, 3) = c.Offset(0, 3).Value
Me.ListBox1.List(i, 4) = c.Offset(0, 4).Value
Me.ListBox1.List(i, 5) = c.Offset(0, 5).Value
Me.ListBox1.List(i, 6) = c.Offset(0, 6).Value
Me.ListBox1.List(i, 7) = c.Offset(0, 7).Value
Me.ListBox1.List(i, 8) = c.Offset(0, 8).Value
Me.ListBox1.List(i, 9) = c.Offset(0, 9).Value
'***ici j'ai ajouté la ligne*******************************
Me.ListBox1.List(i, 10) = c.Offset(0, 10).Value 'une fenetre affiche d'erreur
'************************************************* **
i = i + 1
End If
Next c
End Sub |
Partager