Selecting Unlocked Cells Only

D

Db1712

Is there a way in VBA to have user restricted to selecting only unlocke
cells in a work book. I have tried to password protect each work shee
with the cells formatted as locked or unlocked. However when you sav
and reopen the workbook "sometimes" it reopens allowing the user t
select both locked cells as well as unlocked cells. The locked cell
are still restricted, so if you click on it you get the warning...bu
it's a pain if you're trying to imput data quickly navigating aroun
all the cells on a work sheet
 
J

Jim Rech

An example which goes in the ThisWorkbook module:

Private Sub Workbook_Open()
With Sheet1
.Protect
.EnableSelection = xlUnlockedCells
End With
End Sub

Of course, if the user doesn't enable macros this will not run. The above
is not needed with Excel 2002 and 2003 because you can make these settings
manually and they stick when the workbook is saved (EnableSelection does not
stick pre-2002).
 
Top