+ Reply to Thread
Results 1 to 4 of 4

Trying to use VB to protect and Unprotect a worksheet

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Holland, MI
    MS-Off Ver
    Excel 2007
    Posts
    110

    Trying to use VB to protect and Unprotect a worksheet

    Hi All,
    How do I protect a specific worksheet (not necessarily the "active sheet") with VB. That particular sheet, I initially protected it using "password" the password. Then I'm trying to unprotect the sheet when the userform is initialized. Then when it's terminated, I want to re-protect it. Here is the code I'm trying to use...

    To Unprotect
    Please Login or Register  to view this content.
    To Protect (haven't really tested this one, just assuming it's wrong because the other doesn't work.
    Please Login or Register  to view this content.
    Can someone help me figure out the correct code? Thanks!

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,037

    Re: Trying to use VB to protect and Unprotect a worksheet

    Try:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Holland, MI
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: Trying to use VB to protect and Unprotect a worksheet

    That worked. Thanks!

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,037

    Re: Trying to use VB to protect and Unprotect a worksheet

    My pleasure.

+ 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