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
|
Public Sub chercher(rech As String, c As Integer) ' recherche d'une chaine
Dim sel As Range
Dim valide As Boolean
Dim i As Integer
Dim n As Integer
l = 3
n = 0
With ShParam
UF_remarque.ListBox1.Clear
If rech = "" Then Exit Sub
Do
Set sel = Cells.Find(rech, .Cells(l, c), xlValues, xlPart, xlByColumns, _
xlNext, False)
If sel Is Nothing Then Exit Do
If sel.Column <> c Then Exit Do
If sel.Row <= l Then Exit Do
l = sel.Row
valide = True
If UF_remarque.Controls("Textbox1").Value <> "" And InStr(1, _
LCase(.Cells(l, 3).Value), LCase(UF_remarque.Controls("Textbox1").Value)) = 0 _
Then valide = False
.
.
.
If valide Then
UF_remarque.ListBox1.AddItem .Cells(l, 71)
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 1) = .Cells(l, 3).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 2) = .Cells(l, 4).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 3) = .Cells(l, 7).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 4) = .Cells(l, 12).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 5) = .Cells(l, 6).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 6) = .Cells(l, 8).Value & _
" | " & .Cells(l, 9).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 7) = .Cells(l, 10).Value & _
" | " & .Cells(l, 43).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 8) = .Cells(l, 64).Value & _
" | " & .Cells(l, 66).Value
UF_remarque.ListBox1.List(ListBox1.ListCount - 1, 9) = .Cells(l, 62).Value & _
" | " & .Cells(l, 65).Value & " | " & Cells(l, 63).Value & " || " & .Cells(l, 68).Value & _
" | " & .Cells(l, 67).Value
DonLigne(ListBox1.ListCount - 1) = l
n = n + 1
End If
Loop
End With
End Sub |
Partager