Sub ClearButton1_Click()Dim cell As RangeRange("E5:E12").SelectFor Each cell In SelectionIf cell.Locked = False Then cell.ClearContentsNextRange("G3").ActivateSelection.ClearContentsEnd Sub