PDA

View Full Version : Protecting Cells With A Password In different Work Sheets With Code?



osziej
03-08-2013, 05:14 AM
Hi All

I know how to protect cells, and protect them by using Review tab in my ribbon, and protect sheet, but is there a way I can do this in a code form and add a button on the dashboard that will lock these cells and then once these cells need to change to click the button again retype the password and it allows for editing again?

your help will be well appreciated.

Thank you

osziej
03-11-2013, 04:33 AM
:think:

Teeroy
03-11-2013, 05:07 AM
Have a look at http://www.vbaexpress.com/forum/showthread.php?t=44905. Paul's macro will toggle protection on and off.

osziej
03-13-2013, 05:12 AM
H Teeroy

that is what I'm looking for , but know I need to find out how I can put some sort of button on the dashboard, so when I click on it, it asks for the password and once the password is entered, it unprotected the certain cells that had protection on.

Any ideas?

Teeroy
03-13-2013, 05:38 AM
Cells are locked or unlocked, the protection applies to the sheet. When protection is invoked you can only select unlocked cells.

You can attach the macro call to a button or even a shape. Have a look at http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/. (http://peltiertech.com/WordPress/how-to-assign-a-macro-to-a-button-or-shape/)