I have the following code below to protect cells on all sheets
However when running the macro, I get a run time error "no cells were found" and the code below
It would be appreciated if someone could kindly assist me
However when running the macro, I get a run time error "no cells were found" and the code below
Code:
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
It would be appreciated if someone could kindly assist me
Code:
Sub ProtectAll()
Dim i As Long
For i = 1 To Sheets.Count
With Sheets(i)
.Unprotect
.Cells.Locked = False
.Cells.SpecialCells(xlCellTypeFormulas).Locked = True
.Protect AllowDeletingRows:=True
.Protect AllowInsertingColumns:=True
.Protect AllowFormattingColumns:=True
.Protect AllowFiltering:=True
End With
Next i
With ActiveSheet
.Select
End With
ActiveSheet.Select
End Sub