[/FONT][/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]Private Sub CommandButton4_Click()[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Dim Cpte1 As Integer[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Dim Cpte2 As Integer, TableauLigne()[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] ' Mettre à ZERO les variables globales[/SIZE][/FONT]
[FONT=Times New Roman] [SIZE=3]lastrow = 0: Firstaddress = ""[/SIZE][/FONT]
[FONT=Times New Roman] [/FONT]
[FONT=Times New Roman][SIZE=3] With Me.ListView1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems.Clear[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] With .ColumnHeaders[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Clear[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Société", 100[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Num Facture", 50, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Référence", 50, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Article", 100, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Unité fact.", 85, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Quantité", 85, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Facturé", 40, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Remise", 40, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Add , , "Date", 60, lvwColumnCenter[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End With[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] T = Me.TextBox1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] If T = "" Then Exit Sub[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] R = Me.TextBox2[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]' If R = "" Then Exit Sub[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] S = Me.TextBox3[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]' If S = "" Then Exit Sub[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] [/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Sorted = False[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .FullRowSelect = True[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .Gridlines = True[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .LabelEdit = 1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .View = lvwReport[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End With[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] With ThisWorkbook.Worksheets("Feuil1")[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] DerLgn = .Range("A65535").End(xlUp).Row[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] TabTemp = .Range(.Cells(2, 1), .Cells(DerLgn, 250)).Value[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Set Plage = Application.Intersect(.UsedRange.Cells, .Range(.Cells(8, 1), .Cells(DerLgn, 5))) 'Recherche limitée à cette Plage[/SIZE][/FONT]
[FONT=Times New Roman] [SIZE=3]Set B = Plage.Find(T, LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)[/SIZE][/FONT]
[FONT=Times New Roman] If Not B Is Nothing Then[/FONT]
[FONT=Times New Roman][SIZE=3] Firstaddress = B.Address[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Do[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] ' Recherche du 2ème et 3eme critère dans la ligne[/SIZE][/FONT]
[FONT=Times New Roman] [SIZE=3]If R <> "" Then[/SIZE][/FONT]
[FONT=Times New Roman] Cpte1 = WorksheetFunction.CountIf(.Range(.Cells(B.Row, 6), .Cells(B.Row, 10)), IIf(IsNumeric(R), Val(R), "*" & R & "*"))[/FONT]
[FONT=Times New Roman][SIZE=3] Else: Cpte1 = 1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End If[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] If S <> "" Then[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Cpte2 = WorksheetFunction.CountIf(.Range(.Cells(B.Row, 11), .Cells(B.Row, 15)), IIf(IsNumeric(S), Val(S), "*" & S & "*"))[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Else: Cpte2 = 1[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End If[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] ' Si la valeur est trouvée[/SIZE][/FONT]
[FONT=Times New Roman] [SIZE=3]If Cpte1 > 0 And Cpte2 > 0 Then[/SIZE][/FONT]
[FONT=Times New Roman] With Me.ListView1[/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems.Add , , Sheets("Feuil1").Cells(B.Row, 1)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] x = .ListItems.Count[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 3)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 4)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 5)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 6)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 7)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 8)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 10)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] .ListItems(x).ListSubItems.Add , , Sheets("Feuil1").Cells(B.Row, 2)[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End With[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] End If[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] 'continuer la recherche[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3] Set B = Plage.FindNext(B)[/SIZE][/FONT]
[FONT=Times New Roman] [SIZE=3]Loop While Not B Is Nothing And B.Address <> Firstaddress[/SIZE][/FONT]
[FONT=Times New Roman] End If[/FONT]
[FONT=Times New Roman][SIZE=3] End With[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]End Sub[/SIZE][/FONT]
[FONT=Times New Roman][SIZE=3]