Macro for protecting sheet

J

JoeP

I have recorded a macro that protects a sheet. The coding that I have is

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

When I protect the sheet I want it so that only Unlocked cells can be
selected. My coding above does not do this.

What do I need to do to my code to make it so that a user cannot select
Unlocked cells, and only allow the user to select only Unlocked cells.

Thanks.
 
G

Gord Dibben

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells


Gord Dibben MS Excel MVP
 

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