Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Mois = Range("D" & Target.Row)
Annee = Range("C" & Target.Row)
NumCompte = Range("F" & Target.Row)
With Sheets("Check")
fin = .Range("B" & .Rows.Count).End(xlUp).Row
Set colonne = .Range("C1:E1").Find(NumCompte)
If Not colonne Is Nothing Then
Set debannée = .Range("B1:B" & fin).Find(Annee)
If Not debannée Is Nothing Then
Set moisbloqué = debannée.Resize(13, 1).Find(Mois)
If Not moisbloqué Is Nothing Then
ModifAutorisée = .Cells(moisbloqué.Row, colonne.Column)
End If
End If
End If
End With
If ModifAutorisée = "OUI" Then
MsgBox "Modif non autorisée"
Range("A1").Select
End If
Application.EnableEvents = True
End Sub