View Single Post
  #4   Report Post  
Andy
 
Posts: n/a
Default Still can select locked cells in protected sheet

Anne,

I'm using Excel 2002, and the following macro does what *I* want,
which is to not even be able to select the locked cells:

Sub Workbook_open()
'put this in This Workbook
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.Protect
sh.EnableSelection = xlUnlockedCells
Next sh
End Sub

Without the macro, since I saved the workbook with all the sheets
protected, when I reopen the file I still can't alter the locked
cells, but I can select locked cells. It's not that big a deal but
it's aesthetically less pleasing, since I can click on a protected cell
and see the heavy active cell border, and trigger the error message if
I try to enter something in the protected cell. None of this
behavior is possible if I re-protect the sheets.

I'm fine with my fix above. The problem is that I want to share the
template, and I assume the Workbook_open macro will trigger other
user's macro security warnings.


Andy