Excel VBA-Protect and unprotect sheet with BVA

M

marfrk

I can`t run a macro because the cells are blocked and the shee
protected. How do I unprotect and protect a sheet with BVA code tha
include a prestablished pasword.
Thanks in advance
 
P

Papou

Sheets("Sheet1").UnProtect("YourPwd")
Sheets("Sheet1").Protect("YourPwd")
HTH
Regards
Pascal
 
Top