Public WithEvents cbx As msforms.CheckBox
Dim X As Long, i As Long, z1, z2, z3, z4, z5, z6, z7 As Variant
Private Sub cbx_Change()
User.ListBox1.Clear
z1 = User.ComboBox1: z2 = User.ComboBox2: z3 = User.ComboBox3
If cbx = True Then cbx.Caption = " Indispensable" Else cbx.Caption = " Pas indispensable"
If cbx = True Then cbx.ForeColor = &HFF& Else cbx.ForeColor = &HFF0000
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
If User.CheckBox1 = False Then z4 = Cells(i, 4) Else z4 = IIf(User.CheckBox1, "OUI", "NON")
If User.CheckBox2 = False Then z5 = Cells(i, 5) Else z5 = IIf(User.CheckBox2, "OUI", "NON")
If User.CheckBox3 = False Then z6 = Cells(i, 6) Else z6 = IIf(User.CheckBox3, "OUI", "NON")
If User.CheckBox4 = False Then z7 = Cells(i, 7) Else z7 = IIf(User.CheckBox4, "OUI", "NON")
If Cells(i, 1) = z1 And Cells(i, 2) = z2 And Cells(i, 3) = z3 And Cells(i, 4) = z4 And Cells(i, 5) = z5 _
And Cells(i, 6) = z6 And Cells(i, 7) = z7 Then User.ListBox1.AddItem Cells(i, 8)
Next i
If User.CheckBox1 = False And User.CheckBox2 = False And User.CheckBox3 = False And User.CheckBox4 = False Then
User.ListBox1.Clear
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
If Cells(i, 1) = z1 And Cells(i, 2) = z2 And Cells(i, 3) = z3 Then User.ListBox1.AddItem Cells(i, 8)
Next
End If
End Sub