PDA

View Full Version : Protect cell range with password



Edoloto
10-28-2008, 02:09 PM
Greetings!

I need to protect a range of cells (A5:C96) in my worksheet. The issue here is that I need to have some code to actually unprotect the range of cells (A5:C96) when a button (this is already implemented) is clicked.

So,

1- The user clicks the button - then unprotect the range (A5:C96) with a constant password.
2- Some code runs (this is a bunch of sub's)
3- When finished - then protect the range (A5:C96) with the same constant password.

So on, so forth if the button is clicked again ....

Is this possible?

Thank you,

Eduardo

mdmackillop
10-28-2008, 02:15 PM
Check out Protect and UserInterfaceOnly. This will allow code to run, but protect against manual changes.

Edoloto
10-28-2008, 02:31 PM
Do you have any reference that you know I could read?

Thanks

mdmackillop
10-28-2008, 04:09 PM
VBA Help file.