View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default need code for disable selection of locked cells

You can modify the Scroll Area to restrict which cells can be selected... It
requires a single continuious range of cells though. The user can only move
within that range of cells. Otherwise there is nothing that I know of to keep
the user from selecting a cell. Locking it only protects it from being
updated. You can hide the formula of a locked cell if that helps...

HTH

"David Lewis" wrote:

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?