Adapt sheet Protection

C

Corey

Currently use:

ActiveSheet.protect DrawingObjects:=True, Contents:=True, Scenarios:=False,
AllowFormattingCells:=True


It ALLOWS the user to Select LOCKED Cells still.

How can i have the Cells that are LOCKED to NOT be ENABLED,

Yet have them still able to Select UNLOCKED Cells and be able to Format the Unlocked Cells too?

Is there a :
LockedCellsSelect:=False ?


Corey....
 
H

Himani

When you protect sheet, by default two options are selected and those options
allow user to select locked cells.

Go to Tools -> Protection -> Protect Sheet, in that you'l find list of
options underneath "Allow all users of this worksheet to:" deselect following
options from list
1. Select locked cells
2. Select unlocked cells

Hope this helps !!!
 
C

Coza

Thanks for the reply.
Yes i can MANUALLY change the Locked Cells to Not be able to be selected.
But i want to do this with code.
As i leave the workbook (Close it) and when i open it it reverts back to
Locked cells being able to be selected again.

Corey....
 
H

Himani

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoSelection
 
D

Dave Peterson

Or
.EnableSelection = xlUnlockedCells

Excel won't remember these settings after you close it and reopen the workbook
(so put it in your auto_open or workbook_open procedure)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top