Private Sub ComboAnnée_change()
Dim a As Integer
Dim cherche As String
cherche = ComboAnnée.Value
Dim c As Range, sh As Worksheet
Set sh = Worksheets("Déroulants")
Set c = sh.[AO:AO].Find(ComboRégion, LookIn:=xlValues, lookat:=xlWhole)
TextBox1 = IIf(c Is Nothing, "", c.Offset(, 1))
TextBox2 = IIf(c Is Nothing, "", c.Offset(, 2))
TextBox3 = IIf(c Is Nothing, "", c.Offset(, 3))
TextBox4 = IIf(c Is Nothing, "", c.Offset(, 4))
TextBox5 = IIf(c Is Nothing, "", c.Offset(, 5))
TextBox6 = IIf(c Is Nothing, "", c.Offset(, 6))
a = Sheets("Déroulants").Cells.Find(What:=cherche, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlNext).Row
'MsgBox a
For Each Cell In Sheets("Déroulants").[AO4:A021] ' & .Range("A65536").End(xlUp).Row)
If ComboCouleur = "Rouge" Then
If Cell = Me.ComboRégion And Right(Me.ComboAppellation, 9) <> "SUPERIEUR" And Cell.Offset(0, 2) = Me.ComboDésignation Then
TxtDateMini.Value = TextBox3.Value + CDbl(cherche): TxtDateMaxi = TextBox4 + CDbl(cherche)
TextBox1.Value = "": TextBox2.Value = "": TextBox5.Value = "": TextBox6.Value = ""
End If
If Cell = Me.ComboRégion And Right(Me.ComboAppellation, 9) = "SUPERIEUR" And Cell.Offset(0, 2) = Me.ComboDésignation Then
TxtDateMini.Value = TextBox5.Value + CDbl(cherche): TxtDateMaxi = TextBox6 + CDbl(cherche)
TextBox1.Value = "": TextBox2.Value = "": TextBox3.Value = "": TextBox4.Value = ""
End If
Else
TxtDateMini.Value = TextBox1.Value + CDbl(cherche): TxtDateMaxi = TextBox2 + CDbl(cherche)
TextBox3.Value = "": TextBox4.Value = "": TextBox5.Value = "": TextBox6.Value = ""
End If
Next
End Sub