Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How to Unlock Worksheets with a Macro?
Good morning. A couple of weeks ago, someone from this forum, was very
helpful in my question on how to unprotect protected worksheets, with similar passwords, with a macro. Below is a copy of the VB script I was given. It worked but then I realized, the password "hi" is now visible under the macro script. Is there a way to rewrite the code so that it will not show the password and instead when the macro is run, one has to enter the password before the macro can unprotect the protected worksheets? thank you very much, Storm Option Explicit sub testme() dim myPWD as string dim wks as worksheet myPWD = "hi" for each wks in activeworkbook.worksheets wks.unprotect password:=mypwd next wks end sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macro for all worksheets | Excel Worksheet Functions | |||
How to Unlock | New Users to Excel | |||
Same macro - Different Worksheets!? | Excel Discussion (Misc queries) | |||
how do i password protect an .xls file? how do i unlock it for automation. e.g. want to unlock and access a .xls from another .xls macro. | Excel Worksheet Functions | |||
How do i unlock protected worksheets? | Excel Worksheet Functions |