PDA

View Full Version : sheet protection options



wilg
06-26-2011, 07:42 AM
I have the following code that I use to protect all sheets in my workbook.

Sub ProtectAll()
Dim Sh As Worksheet
Dim myPassword As String
myPassword = "password"
For Each Sh In ThisWorkbook.Worksheets
Sh.Protect Password:=myPassword
Next Sh
End Sub

Is there a way to modify so that select locked cells in unchecked or false in the protection options?

Rob342
06-26-2011, 02:26 PM
Hi Wilg

Try this

Range("A1").Select
Selection.Locked = False


Rob

wilg
06-26-2011, 03:03 PM
Sorry, maybe I should clarify further. When protecting sheets I want under where you would normally key your password....

"Allow all users using this workbook too.."

"Select Locked Cells" false. or Unchecked.

Rob342
06-28-2011, 08:22 AM
Wilg

Do you want an input box to allow all users to select all locked cells with either "Y" or "N" ????

Rob