+ Reply to Thread
Results 1 to 6 of 6

Reprotect after macro exits.

  1. #1
    Registered User
    Join Date
    08-11-2008
    Location
    Antioch, TN
    Posts
    20

    Reprotect after macro exits.

    Thanks to the wonderful help of everyone on the forum, I've almost finished my project; however, I have one last bit of code I can't figure out.

    Please Login or Register  to view this content.
    The code unprotects the sheets to run the macro properly (to avoid a nasty GoTo error). It also reprotects the sheets after the macro has run its course...except, if the user selects "No" the sub ends without reprotecting the sheet. This is my last bit of code & any help is greatly appreciated!

    By the way, the Open Event has a UserInterfaceOnly protection for the entire workbook. (See note below for reference)

    By the way, much thanks to Forum Moderator shg. Without his patience and assistance, I never would have gotten this far (I probably would have thrown in the towel!)

    I have attached my somewhat lame project for all to try to understand.
    Attached Files Attached Files

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372
    How 'bout

    Please Login or Register  to view this content.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Try this:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    08-11-2008
    Location
    Antioch, TN
    Posts
    20
    You are a genius! However, one problems builds another. But 1 modification (I can be taught) and it's PERFECT!

    Please Login or Register  to view this content.
    Note my need to apply the protection again before the last end if. It wasn't reprotecting the very first sheet it searched. THANK YOU!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    If you use my code, it reprotects immediately after the Goto.

  6. #6
    Registered User
    Join Date
    08-11-2008
    Location
    Antioch, TN
    Posts
    20
    Very nice. That's my solution. Thank you again. I couldn't have done it without your help. I just hope that I can help someone on here someday with the knowledge I'm gathering from just perusing the forum.

+ 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