I have a workbook with 5 sheets which are full of formulas and I need to make them safe uneditable. I have found through Stackoverflow a simple code that protects formulas and it’s working perfectly but it affects the other codes in my workbook not to run properly such as inserting images based on a cell value – my images stopped to be updated when I change a cell value….and I dont know how to fix that. any sugesstions please ?… here in below my code
Sub LockSheets()
Dim ws As Worksheet
For Each ws In Worksheets
With ws
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect
End With
Next ws
End Sub