I have our spreadsheet protected to where you cannot select locked cells. however everytime i open the worksheet it is defaulted back to being able to select locked cells. any ideas?
This is one of those settings that has to be reset after you close the workbook.
I'd put it in the auto_open or workbook_open.
Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Unprotect Password:="hi"
.EnableSelection = xlUnlockedCells
.Protect Password:="hi"
End With
End Sub
Hi Jeff
this setting is not stored by Excel (only MS know why). Try putting the
following code in your workbook module (not in a standard module)
Private Sub Workbook_Open()
Dim wks as worksheet
set wks = worksheets("Sheet1")
wks.Unprotect Password:= "your password"
wks.EnableSelection = xlUnlockedCells
wks.Protect Password:="your password"
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.