Option Explicit
Private Sub UserForm_Initialize()
Dim L As Integer
With Me.ListBox28
.ColumnCount = 3
.ColumnWidths = '90;40;40'
End With
With Feuil3
For L = 1 To .Range('A5000').End(xlUp).Row
Me.ComboBox1.AddItem .Cells(L, 1)
Next
End With
End Sub
Private Sub ComboBox1_Change()
TextBox19 = ComboBox1.Value
End Sub
Private Sub TextBox19_Change()
Dim Plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim N As Integer
ListBox28.Clear
Recherche = TextBox19.Value
With Feuil2
Set Plage = Range(.Range('A2'), .Range('A65536').End(xlUp))
End With
With Plage
Set Cell = .Find(Recherche, LookAt:=xlWhole)
If Not Cell Is Nothing Then
Adresse = Cell.Address
Do
With ListBox28
.AddItem Cell.Offset(0, 3), N
.List(N, 1) = Cell.Offset(0, 1)
.List(N, 2) = Cell.Offset(0, 2)
End With
N = N + 1
Set Cell = .FindNext(Cell)
Loop While Not Cell Is Nothing And Not Cell.Address = Adresse
End If
End With
End Sub
Private Sub CommandButton2_Click()
Dim L As Integer, C As Byte
With ListBox28
If .ListCount = 0 Then Exit Sub
For L = 1 To .ListCount
For C = 1 To 3
Sheets('FicheArchive').Cells(L, C) = .List(L - 1, C - 1)
Next
Next
End With
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub