Option Explicit
Dim Tableau As Variant
Dim LstVqItem As MSComctlLib.ListItem
Sub reliste()
Dim I&, colonne&, critere As Boolean, D As Date, critere2 As Boolean
With ListView1
.ListItems.Clear
For I = 2 To UBound(Tableau)
Select Case True
Select Case True
Case ComboBox2 <> "" And ComboBox3 = "": critere = Left(Tableau(I, 3), Len(ComboBox2)) = ComboBox2
Case ComboBox2 = "" And ComboBox3 <> "" And Len(ComboBox3) = 10 And IsDate(ComboBox3): critere = CDate(Tableau(I, 9)) = CDate(ComboBox3)
Case ComboBox2 <> "" And ComboBox3 <> "" And Len(ComboBox3) = 10 And IsDate(ComboBox3): critere = Left(Tableau(I, 3), Len(ComboBox2)) = ComboBox2: critere2 = CDate(Tableau(I, 9)) = CDate(ComboBox3): critere = critere And critere2
Case ComboBox2 = "" And ComboBox3 = "": critere = True
End Select
If critere Then
Set LstVqItem = .ListItems.Add(Text:=Tableau(I, 1))
For colonne = 2 To UBound(Tableau, 2)
With LstVqItem
.ListSubItems.Add , , Tableau(I, colonne)
End With
Next
End If
Next
End With
End Sub
Private Sub Frame7_Click()
End Sub
Private Sub ListView1_BeforeLabelEdit(Cancel As Integer)
End Sub
Private Sub ComboBox2_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger): KeyAscii = Asc(UCase(Chr(KeyAscii))): End Sub
Private Sub ComboBox2_Change(): reliste: End Sub
Private Sub ComboBox3_Change(): reliste: End Sub
Private Sub UserForm2_Initialize()
Dim I&, colonne&
With UserForm2.ListView1
.ListItems.Clear
With .ColumnHeaders
.Clear
.Add Text:="Dossier°", Width:=40, Alignment:=lvwColumnLeft
.Add Text:="Date", Width:=40, Alignment:=fmAlignmentLeft
.Add Text:="Agent", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Civilité", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Nom", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Prénom", Width:=80, Alignment:=fmAlignmentLeft
.Add Text:="Société", Width:=80, Alignment:=fmAlignmentLeft
.Add Text:="Adresse", Width:=60, Alignment:=lvwColumnLeft
.Add Text:="Téléphone Fixe", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Portable", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Mail", Width:=80, Alignment:=lvwColumnLeft
.Add Text:="Raison de l'appel(Liste)", Width:=80, Alignment:=fmAlignmentLeft
.Add Text:="Autre raison d'appel(hors-liste)", Width:=80, Alignment:=fmAlignmentLeft
End With
.Gridlines = True: .BorderStyle = ccFixedSingle: .FullRowSelect = True: .View = lvwReport
Tableau = Sheets("BASE DE DONNEES").Range("A1", Cells(Rows.Count, "P").End(xlUp)).Value
For I = 2 To UBound(Tableau)
Set LstVqItem = .ListItems.Add(Text:=Tableau(I, 1))
With LstVqItem
For colonne = 2 To UBound(Tableau, 2)
.ListSubItems.Add , , Tableau(I, colonne)
Next
End With
Next
End With
End Sub
Private Sub MultiPage1_Change()
End Sub