PDA

View Full Version : Clear protected cells



mqdias
10-23-2007, 07:17 AM
Hi,

I've created some protection for my sheets with a password. The problem is that one of the instructions in the code is to clear the contents of some cells, but because they are protected, it gives me an error.
Is there any way that i can protect my sheets so that anyone can change the cell's values, and be changed by visual basic code?

thanks

Bob Phillips
10-23-2007, 07:20 AM
unprotect the sheet in code, change the cells, then re-protect.

mqdias
10-23-2007, 07:37 AM
Hi

I've already remembered to do that, but i don't know how to do it....:(

Can you help me please? It's protected with a password...


Thank you soo much!

Bob Phillips
10-23-2007, 07:38 AM
Activesheet.Unprotect Password:="mypassword"

'do your stuff

Activesheet.Protect Password:="mypassword"

mqdias
10-23-2007, 07:54 AM
Thank you very very much!!! Once more...

Simple and effective!!!!

Great!!:bow: