PDA

Click to See Complete Forum and Search --> : [RESOLVED] excel protection question


krtxmrtz
Jun 23rd, 2006, 04:38 AM
If a sheet is protected, is it possible to disable selection / activation of locked cells?

indiewolf
Jun 23rd, 2006, 04:56 AM
first unprotect sheet

then format>sheet>unhide

for unprotecting sheet loads of code available ..use google.

krtxmrtz
Jun 23rd, 2006, 06:32 AM
first unprotect sheet

then format>sheet>unhide

for unprotecting sheet loads of code available ..use google.
Not sure what you mean. Are you referring to the format menu? The sheet is not hidden. As for unprotecting the sheet, I've got the line of code to do that.

DKenny
Jun 23rd, 2006, 09:24 AM
To only allow the use to select/activate unlocked cells, use the EnableSelection property of the sheet before you cal the Protect method.
With ThisWorkbook.Worksheets(1)
.EnableSelection = xlUnlockedCells
.Protect Password:="declan"
End With

krtxmrtz
Jun 25th, 2006, 03:32 AM
To only allow the use to select/activate unlocked cells, use the EnableSelection property of the sheet before you cal the Protect method.
With ThisWorkbook.Worksheets(1)
.EnableSelection = xlUnlockedCells
.Protect Password:="declan"
End With
Thanks, do you know if this is going to work for Excel versions older than 2000 as well? I can't test it at the moment.

krtxmrtz
Jun 26th, 2006, 03:00 AM
I've just tested it under Win98 / Excel 97 and it does work, so you can't disable locked cell selection by means of the Protect -> Sheet menu, but your code does the job.

Thanks again, DK.