Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim CM As Long
Dim c As Range
'deprotege et verrou sur toute la feuille
ActiveSheet.Unprotect
ActiveSheet.Cells.Locked = True
'target count = CM ( c'est à dire: soit 1, soit > 1 si fusion)
For Each c In Target
CM = IIf(c.MergeCells, CM + 1, 1)
Next c
If Target.Count = CM Then
If Target.Interior.ColorIndex = xlNone _
Or Target.Interior.ColorIndex = 2 Then
Target.Locked = False
End If
End If
ActiveSheet.Protect AllowFormattingCells:=True
End Sub