bonjour a tous un petit renseignement dans ce code
Private Sub CommandButton1_Click()
k = 0
Me.ListBox1.Clear
If Me.TextBox2 = "" Then Me.TextBox2 = "*"
If Me.TextBox1 = "" Then Me.TextBox1 = "*"
For i = 2 To [A65000].End(xlUp).Row
If Cells(i, 1) Like "*" & Me.TextBox1 & "*" _
And Cells(i, 5) Like TextBox2 Then
Me.ListBox1.AddItem
Me.ListBox1.List(k, 0) = Cells(i, 1)
Me.ListBox1.List(k, 1) = Cells(i, 2)
Me.ListBox1.List(k, 2) = Cells(i, 3)
Me.ListBox1.List(k, 3) = Cells(i, 4)
Me.ListBox1.List(k, 4) = Cells(i, 5)
Me.ListBox1.List(k, 5) = i
k = k + 1
End If
Next i
End Sub
a quoi correspond List(k, 0) = Cells(i, 1)
et comment rajouter un critere de recherche par textbox
Private Sub CommandButton1_Click()
k = 0
Me.ListBox1.Clear
If Me.TextBox2 = "" Then Me.TextBox2 = "*"
If Me.TextBox1 = "" Then Me.TextBox1 = "*"
For i = 2 To [A65000].End(xlUp).Row
If Cells(i, 1) Like "*" & Me.TextBox1 & "*" _
And Cells(i, 5) Like TextBox2 Then
Me.ListBox1.AddItem
Me.ListBox1.List(k, 0) = Cells(i, 1)
Me.ListBox1.List(k, 1) = Cells(i, 2)
Me.ListBox1.List(k, 2) = Cells(i, 3)
Me.ListBox1.List(k, 3) = Cells(i, 4)
Me.ListBox1.List(k, 4) = Cells(i, 5)
Me.ListBox1.List(k, 5) = i
k = k + 1
End If
Next i
End Sub
a quoi correspond List(k, 0) = Cells(i, 1)
et comment rajouter un critere de recherche par textbox