ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protection within Macro (https://www.excelbanter.com/excel-programming/344860-protection-within-macro.html)

NickMinUK[_2_]

Protection within Macro
 

Is it possible to unprotect a protected sheet where a password is used
then re-protect with the same password, all within a macro. So far
have unprotected/reprotected with no password, but clearly this is o
minimal use. Any help most gratefully received. Nic

--
NickMinU
-----------------------------------------------------------------------
NickMinUK's Profile: http://www.excelforum.com/member.php...fo&userid=1055
View this thread: http://www.excelforum.com/showthread.php?threadid=48267


Rowan Drummond[_3_]

Protection within Macro
 
Sheets("MySheet").unprotect password:="mypassword"
'do whatever
Sheets("MySheet").protect password:="mypassword"

Hope this helps
Rowan

NickMinUK wrote:
Is it possible to unprotect a protected sheet where a password is used,
then re-protect with the same password, all within a macro. So far I
have unprotected/reprotected with no password, but clearly this is of
minimal use. Any help most gratefully received. Nick



NickMinUK[_3_]

Protection within Macro
 

Thanks Rowan. It works, and now that I've discovered how to protect the
macro aswell, i reckon i'm pretty well covered.


--
NickMinUK
------------------------------------------------------------------------
NickMinUK's Profile: http://www.excelforum.com/member.php...o&userid=10558
View this thread: http://www.excelforum.com/showthread...hreadid=482671


Rowan Drummond[_3_]

Protection within Macro
 
You're welcome.

NickMinUK wrote:
Thanks Rowan. It works, and now that I've discovered how to protect the
macro aswell, i reckon i'm pretty well covered.




All times are GMT +1. The time now is 05:00 PM.

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