View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Storm Storm is offline
external usenet poster
 
Posts: 58
Default How to Unlock Worksheets with a Macro?

Will do. Wasn't getting any hits initially...so I thought if someone was
responding more under the other forum, I'd give it a try.

"Dave Peterson" wrote:

Check your other post.

It's not necessary to post the same question to multiple newsgroups. But if you
think you must, then instead of multiposting (the same/similar question sent to
individual groups), you could crosspost (single question sent once to all the
groups).



Storm wrote:

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


--

Dave Peterson