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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
Private Sub ComboBox1_Click()
Application.ScreenUpdating = False
Sheets("Reglages").Select
Dim I As Long, nbLignes As Long, nblignes2 As Long, nblignes3 As Long, nblignes4 As Long
nbLignes = Cells(Rows.Count, "B").End(xlUp).Row
nblignes2 = Cells(Rows.Count, "C").End(xlUp).Row
nblignes3 = Cells(Rows.Count, "D").End(xlUp).Row
nblignes4 = Cells(Rows.Count, "E").End(xlUp).Row
'Combobox 2
For I = 2 To nblignes2 'C
If Range("B" & I) = ComboBox1.Value And Range("A" & I) = y Then
If Range("C" & I) <> "" Then
Me.ComboBox2 = Range("C" & I)
If Me.ComboBox2.ListIndex = -1 Then Me.ComboBox2.AddItem Range("C" & I)
End If
End If
Next
Sheets("Carte").Activate
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Private Sub ComboBox2_Click()
Application.ScreenUpdating = False
Sheets("Reglages").Select
Dim I As Long, nbLignes As Long, nblignes2 As Long, nblignes3 As Long, nblignes4 As Long
nbLignes = Cells(Rows.Count, "B").End(xlUp).Row
nblignes2 = Cells(Rows.Count, "C").End(xlUp).Row
nblignes3 = Cells(Rows.Count, "D").End(xlUp).Row
nblignes4 = Cells(Rows.Count, "E").End(xlUp).Row
'Combobox 3
For I = 2 To nblignes3 ' D
If Range("C" & I) = ComboBox2.Value And Range("B" & I) = ComboBox1.Value And Range("A" & I) = y Then
If Range("D" & I) <> "" Then
Me.ComboBox3 = Range("D" & I)
If Me.ComboBox3.ListIndex = -1 Then Me.ComboBox3.AddItem Range("D" & I)
End If
End If
Next
Sheets("Carte").Activate
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Private Sub ComboBox3_Click()
Application.ScreenUpdating = False
Sheets("Reglages").Select
Dim I As Long, nbLignes As Long, nblignes2 As Long, nblignes3 As Long, nblignes4 As Long
nbLignes = Cells(Rows.Count, "B").End(xlUp).Row
nblignes2 = Cells(Rows.Count, "C").End(xlUp).Row
nblignes3 = Cells(Rows.Count, "D").End(xlUp).Row
nblignes4 = Cells(Rows.Count, "E").End(xlUp).Row
'Combobox 4
For I = 2 To nblignes4 ' E
If Range("D" & I) = ComboBox3.Value And Range("C" & I) = ComboBox2.Value And Range("B" & I) = ComboBox1.Value And Range("A" & I) = y Then
If Range("E" & I) <> "" Then
Me.ComboBox4 = Range("E" & I)
If Me.ComboBox4.ListIndex = -1 Then Me.ComboBox4.AddItem Range("E" & I)
End If
End If
Next
Sheets("Carte").Activate
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub |
Partager