+ Reply to Thread
Results 1 to 6 of 6

Password protect and unprotect all sheets EXCEPT two named sheets

  1. #1
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Password protect and unprotect all sheets EXCEPT two named sheets

    Hello all, I have searched and tried with my extremely limited VBA skills to adapt the below code to ensure two named sheets ('Watch Allocation' and 'Working sheet')will not be protected. The reason for the omission is that one named sheet 'Working sheet' (it is hidden) reads from others and if protected throws up a Run-time error 1004 due to protecting the 'Working Sheet'. I can have all sheets protected manually (large area are unlocked to allow data entry) and no errors will occur but when speeding up the protecting process via VBA gives that Run-time error.

    Please Login or Register  to view this content.
    So, the question is how can I omit two defined sheets into the above code? Many thanks for any assistance.
    Last edited by Ducatisto; 08-29-2012 at 05:44 AM. Reason: Solved with thanks.

  2. #2
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Password protect and unprotect all sheets EXCEPT two named sheets

    This code protects all the sheets. Edit it somehow to make it skip the 2 shits you want

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Password protect and unprotect all sheets EXCEPT two named sheets

    I got it! kind of funny though hehe
    Please Login or Register  to view this content.
    First code is for protecting other one is for unprotecting

  4. #4
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Re: Password protect and unprotect all sheets EXCEPT two named sheets

    I did have it working so I thought but upon closing down and reopening it failed to work. Although the code supplied by 'stojko89' works in its own right I need to implement the unprotecting of my "Working sheet" into the code I supplied in my first post which to date I have failed miserably! I want 'super users' to be able to input the password via InputBox and not just run a macro to protect and unprotect so any saviours out ther that can make my code work I would be eternally grateful.
    Last edited by Cutter; 08-29-2012 at 10:46 AM. Reason: Removed whole post quote

  5. #5
    Forum Contributor stojko89's Avatar
    Join Date
    05-18-2009
    Location
    Maribor, Slovenia
    MS-Off Ver
    MS Office 365
    Posts
    913

    Re: Password protect and unprotect all sheets EXCEPT two named sheets

    Here you go:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-05-2005
    Location
    Basingstoke, England
    MS-Off Ver
    2003
    Posts
    86

    Re: Password protect and unprotect all sheets EXCEPT two named sheets

    Truly solved now, many thanks. I was close before but for the life of me did not see my error, thanks again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1