Sub lock_formulas()
Set FormulaCells = ActiveSheet.Range("A1").SpecialCells(xlFormulas, xlNumbers + xlTextValues + xlLogical)
If Not IsEmpty(FormulaCells) Then
For Each Area In FormulaCells.Areas
With ActiveSheet.Range(Area.Address)
.Locked = True
End With
Next Area
End If
End Sub