1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Private Sub TextBox2_Change()
If Me.TextBox2 = "" Then
B_tout_Click
Exit Sub
End If
Set mondico = CreateObject("Scripting.Dictionary")
Me.ListBox1.Clear
i = 0
Set plage = [BASE]
Set plageRech = Application.Index(Range("Base2"), , 3)
Set C = plageRech.Find(Me.TextBox2, , , xlPart)
If Not C Is Nothing Then
premier = C.Address
Do
If Not mondico.Exists(C.Row) Then
mondico.Add C.Row, C.Row
Me.ListBox1.AddItem
lig = C.Row - plage.Row + 1
For col = 1 To NbCol
Me.ListBox1.List(i, col - 1) = plage.Cells(lig, col)
Next col
i = i + 1
End If
Set C = plageRech.FindNext(C)
Loop While Not C Is Nothing And C.Address <> premier
End If
End Sub |
Partager