ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Protect and NOT be able to selct locked cells (https://www.excelbanter.com/excel-programming/362586-vba-protect-not-able-selct-locked-cells.html)

brucemc[_5_]

VBA Protect and NOT be able to selct locked cells
 

The VBA help for the protect method covers a number of items, but for
some reason, completely omits the very first two items when you use
Protect from the drop-down menus, Select Locked Cells and Select
Unlocked Cells. I specifically want to deny selecting everything except
unlocked cells (case in point: selection of locked cells) via VBA. Each
sheet have very few unlocked cells. I find I can protect via menu and
deny the locked cells, but at some point while sheets are being
unprotected and reprotected via VBA, the idiot locked cells become
selectable again. I know I must be missing something obvious here, but
I can't see it whatsoever.

How can I have VBA protect method also deny selection of locked cells?


--
brucemc
------------------------------------------------------------------------
brucemc's Profile: http://www.excelforum.com/member.php...o&userid=32871
View this thread: http://www.excelforum.com/showthread...hreadid=546080


Dave Peterson

VBA Protect and NOT be able to selct locked cells
 
Look at EnableSelection in VBA's help.

brucemc wrote:

The VBA help for the protect method covers a number of items, but for
some reason, completely omits the very first two items when you use
Protect from the drop-down menus, Select Locked Cells and Select
Unlocked Cells. I specifically want to deny selecting everything except
unlocked cells (case in point: selection of locked cells) via VBA. Each
sheet have very few unlocked cells. I find I can protect via menu and
deny the locked cells, but at some point while sheets are being
unprotected and reprotected via VBA, the idiot locked cells become
selectable again. I know I must be missing something obvious here, but
I can't see it whatsoever.

How can I have VBA protect method also deny selection of locked cells?

--
brucemc
------------------------------------------------------------------------
brucemc's Profile: http://www.excelforum.com/member.php...o&userid=32871
View this thread: http://www.excelforum.com/showthread...hreadid=546080


--

Dave Peterson

brucemc[_7_]

VBA Protect and NOT be able to selct locked cells
 

Outstanding!


--
brucemc
------------------------------------------------------------------------
brucemc's Profile: http://www.excelforum.com/member.php...o&userid=32871
View this thread: http://www.excelforum.com/showthread...hreadid=546080



All times are GMT +1. The time now is 08:36 AM.

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