Hi
The code below will lock all cells on the sheet, then unlock only the constats.
Sub aaa()
Dim SI As Worksheet
On Error Resume Next
For Each SI In Worksheets
With SI
.Unprotect "Password"
.Cells.Locked = True
.Cells.SpecialCells(xlCellTypeConstants, 1).Locked = False
.Protect "Password"
End With
Next SI
End Sub
This code will unlock all cells, and then lock the formulas and text.
Sub bbb()
Dim SI As Worksheet
On Error Resume Next
For Each SI In Worksheets
With SI
.Unprotect "Password"
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Cells.SpecialCells(xlCellTypeConstants, 2).Locked = True
.Protect "Password"
End With
Next SI
End Sub
rylo
Bookmarks