View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
David Lewis[_3_] David Lewis[_3_] is offline
external usenet poster
 
Posts: 2
Default need code for disable selection of locked cells

All I know is my code locks the page. When I save and close and go back I can select the cells again.
If I manually lock the cells and uncheck the locked cells option then it works properly.

"Norman Jones"
|Hi David,
|
| I need to disable selection of locked cells
| Is there a function like ws.DisableSelection = xlLockedCells?
|
|That is what your code does.
|
|If, as in your code, you set the EnableSelection to unlocked cells, only
|unlocked cells can be selected - locked cells become unselectable.
|
|---
|Regards,
|Norman
|
|
|
|"David Lewis" wrote in message
. ..
| Got code
| Sub protect()
|
| Dim ws As Worksheet
|
| For Each ws In ActiveWorkbook.Worksheets
| ws.EnableSelection = xlUnlockedCells
| ws.protect Password:=""
| Next ws
|
| End Sub
|
| I need to disable selection of locked cells
| Is there a function like ws.DisableSelection = xlLockedCells?
|
|