I think the only reason you have to check to see if the cell is
locked or not is because you are selecting multiple ranges, which is
not possible. If I were to keep it simple, and already know
specifically what cells I want to clear, I would just do something
like this:
Private Sub ClearButton1_Click()
[E5:E12].ClearContents
[G3].ClearContents
End Sub