ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adapt sheet Protection (https://www.excelbanter.com/excel-programming/387793-adapt-sheet-protection.html)

Corey

Adapt sheet Protection
 
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....



Himani[_2_]

Adapt sheet Protection
 
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 !!!

"Corey" wrote:

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....




Coza

Adapt sheet Protection
 
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....
"Himani" wrote in message
...
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 !!!

"Corey" wrote:

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....






Himani[_2_]

Adapt sheet Protection
 
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlNoSelection

"Coza" wrote:

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....
"Himani" wrote in message
...
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 !!!

"Corey" wrote:

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....







Dave Peterson

Adapt sheet Protection
 
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)

Himani wrote:

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

"Coza" wrote:

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....
"Himani" wrote in message
...
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 !!!

"Corey" wrote:

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....







--

Dave Peterson


All times are GMT +1. The time now is 05:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com