Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column > 1 Then Exit Sub
Dim an%, mois As Byte, i&, r As Range, a%, m As Byte
Cancel = True
an = Year([G2]) 'cellule à adapter
mois = Month([G2])
For i = Target.Row + 1 To [A65536].End(xlUp).Row
Set r = Cells(i, 1)
If r <> "" Then
a = 0: m = 0
If IsDate(r) Then a = Year(r): m = Month(r)
If a <> an Or m <> mois Or Application.CountIf(r(1, 2).Resize(, 3), "C") = 0 _
And Application.CountIf(r(1, 2).Resize(, 3), "D") = 0 Then
r.Resize(, 4).Select
MsgBox "Erreur en ligne " & i
Exit For
End If
End If
Next
End Sub