Depends on how you want to deal with when you have merged cells but you cannot use vba to set the locked property of only one cell of a group of merged cells. This approach would adjust the range you select to include merged areas:
Sub macro_1()
Dim Rng1, cl
ActiveSheet.UsedRange.Locked = True
With ActiveSheet
Set Rng1 = Union(.Range("C1"), .Range("L1"), .Range("E4: E8"), .Range("E11: E17"), .Range("L11: L17"), .Range("E20: E22"))
End With
For Each cl In Rng1.Cells
If cl.MergeCells = True Then
Set Rng1 = Union(Rng1, cl.MergeArea)
End If
Next
Rng1.Locked = False
End Sub
Bookmarks