Hi Everyone,
I have been trying to solve this for quite a while but I do not seem to find the solution. I have a macro to protect all Sheets in a workbook in Excel 2010. Below the code:
Sub ProtectAllSheets()
' Loop through all sheets in the workbook.
For i = 1 To Sheets.Count
Application.ScreenUpdating = False
Sheets(i).Select
Call ProtectOneSheet
Next i
End Sub
Sub ProtectOneSheet()
Application.ScreenUpdating = False
With ActiveSheet
.Protect Password:="1", UserInterFaceOnly:=True
.EnableSelection = UnlockedCells
End With
End Sub
When I try to edit/delete the content of 1 cell Excel says that it is protected. However, when I select more than 1 cell (including locked cells) I can delete the content!! (FYI: I need the user to be able to select locked cells in a protected workbook).
Any idea why this is happening?
Thank you very much in advance!
Best,
Daniel
Bookmarks