Hi!
I have created a simple script that is supposed to lock all the cells that don't have a specific color. It worked fine on my test document but when I tried it on the excel project that I designed it for I got the error message "Run-time error '1004': Unable to set the locked property of the Range class." I believe that it is the merged cells are the cause of the problem. Is it possible to edit the script so it could work on merged cells as well.

Sub Protection()
For Each c In ActiveSheet.UsedRange
Debug.Print c.Interior.ColorIndex
If c.Interior.ColorIndex = 36 Then
c.Locked = False
Else
c.Locked = True
End If
Next c
End Sub

Kind Regards
Lars