Saturday, April 20, 2019

Protect all the Cells With Formulas


Protect all the Cells With Formulas
To protect cell with formula with a single click you can use this code.
Sub lockCellsWithFormulas()
With ActiveSheet
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect AllowDeletingRows:=True
End With
End Sub

No comments:

Post a Comment