How do you protect multiple worksheets at the same time while only allowing users to select unlocked cells? I am aware that Excel does not support this function unless you run a VBA macro. I found the VBA code to protect multiple worksheets at the same time, but when I test the worksheet, a user can select any cell they desire. I want users to only manipulate unlocked cells. I have several complex formulas that need to be preserved. The following is the code I already have. Can someone please help me?
Sub ProtectAllSheets()
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="secret123"
Next ws
MsgBox "All Worksheets Protected"
End Sub
Sub UnProtectAllSheets()
For Each ws In ActiveWorkbook.Worksheets
ws.Unprotect Password:="secret123"
Next ws
MsgBox "All Worksheets Unlocked"
End Sub
Bookmarks