Sub Compteur1_QuandChangement()
Dim lig As Long
ActiveSheet.Unprotect
For lig = 5 To Cells(Rows.Count, "D").End(xlUp).Row - 1
If IsDate(Cells(lig, "D")) And Cells(lig, "H") = 1 Then
If IsDate(Cells(lig, "D")) And Cells(lig, "C") = 1 Then
Cells(lig, "M").Resize(1).Locked = True
Else
Cells(lig, "M").Resize(1).Locked = False
End If
End If
Next lig
ActiveSheet.Protect
End Sub