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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| Dim Plage As Range, Cell As Range
Dim Recherche As String, Adresse As String
Dim Ligne As Integer, N As Integer
Dim C As Range
Dim Row As Long
ListBox1.Clear
N = 0
Recherche = TextBox5.Value
Range("D4").Select
Ligne = Feuil1.Range("D" & "65536").End(xlUp).Row
Set Plage = Feuil1.Range("D" & "1:" & "I" & Ligne)
'Set Plage = Feuil1.Range("D5:I25")
With Plage
Set C = .Find(Recherche)
If Not C Is Nothing Then
Adresse = C.Address
Do
If UCase(Recherche) = UCase(Left(C, Len(Recherche))) Then
Row = C.Row - Plage.Row + 1
'alimentation listBox
ListBox1.AddItem .Cells(Row, 1), N
' ListBox1.List(N, 1) = C
ListBox1.List(N, 1) = .Cells(Row, 2)
ListBox1.List(N, 2) = .Cells(Row, 3)
ListBox1.List(N, 3) = .Cells(Row, 4)
ListBox1.List(N, 4) = .Cells(Row, 5)
ListBox1.List(N, 5) = .Cells(Row, 6)
N = N + 1
'alimentation listBox
' ListBox1.AddItem C.Offset(0, 0), N
' ListBox1.List(N, 1) = C
' ListBox1.List(N, 1) = C.Offset(0, 1)
' ListBox1.List(N, 2) = C.Offset(0, 2)
' ListBox1.List(N, 3) = C.Offset(0, 3)
' ListBox1.List(N, 4) = C.Offset(0, 4)
' ListBox1.List(N, 5) = C.Offset(0, 5)
' N = N + 1
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> Adresse
End If
End With |
Partager