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
| Private Sub TextBox88_Change()
On Error Resume Next
ListBox4.Visible = True
Dim ws As Worksheet
Dim V As Integer
V = 1
Dim arrLstBox(1 To 100, 1 To 50)
Dim LastRow As Integer
Dim M As String
Dim q, F
ListBox4.Clear
If TextBox88.Text = "" Then GoTo 1
M = TextBox88.Text
Set ws = Sheets("Clients")
With ws
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row
Set q = .Range("C9:C" & LastRow).Find(M)
ListBox4.ColumnCount = 50
If Not q Is Nothing Then
F = q.Address
Do
If Application.WorksheetFunction.Search(M, q, 0) = 1 Then
ListBox4.AddItem q.Value
arrLstBox(V, 1) = q.Value
arrLstBox(V, 2) = q.Offset(0, 1).Value
arrLstBox(V, 3) = q.Offset(0, -1).Value
arrLstBox(V, 4) = q.Offset(0, 4).Value
arrLstBox(V, 5) = q.Offset(0, 2).Value 'qte
arrLstBox(V, 6) = q.Offset(0, 6).Value
arrLstBox(V, 7) = q.Offset(0, 8).Value + q.Offset(0, 9).Value
arrLstBox(V, 8) = q.Offset(0, 10).Value
arrLstBox(V, 9) = q.Offset(0, 3).Value
arrLstBox(V, 10) = q.Offset(0, 5).Value
arrLstBox(V, 11) = q.Offset(0, 3).Value
arrLstBox(V, 12) = q.Offset(0, 5).Value
arrLstBox(V, 13) = q.Offset(0, 3).Value
V = V + 1
End If
Set q = .Range("C9:C" & LastRow).FindNext(q)
Loop While Not q Is Nothing And q.Address <> F
ListBox4.List = arrLstBox()
End If
End With
1
TextBox96 = ""
TextBox97 = ""
TextBox98 = ""
TextBox89 = ""
TextBox90 = ""
TextBox91 = ""
TextBox92 = ""
TextBox93 = ""
TextBox94 = ""
TextBox95 = ""
TextBox118 = ""
TextBox119 = ""
End Sub |