+ Reply to Thread
Results 1 to 2 of 2

Prompt user when unprotecting sheet

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 (Windows)
    Posts
    4

    Prompt user when unprotecting sheet

    I'm trying to make a popup show up when the user tries to unprotect a protected sheet. The popup will tell them they're doing something sketchy and ask if they really want to do it (yes/no). Then, based on that response, I'll have the sheet unprotect or stay protected. I've tried to combine codes from these two websites (making the necessary tweaks):

    http://stackoverflow.com/questions/2...event-in-excel
    and
    http://www.vb6.us/tutorials/understa...d-visual-basic

    I ended up with the following:

    Please Login or Register  to view this content.
    The code works fine when I manually run the macro UnprotectAlert... It pops up only if the sheet is currently protected, and then if I click yes, the sheet will unprotect, and if I click no, it will stay protected)... BUT it doesn't actually get triggered when I unprotect the sheet. What am I missing?

    I'm a newbie to VBA, but a decent programmer/logical person . Thanks for any help y'all can give!!

  2. #2
    Registered User
    Join Date
    04-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2007 (Windows)
    Posts
    4

    Re: Prompt user when unprotecting sheet

    For anyone stumbling upon this thread, I'll post the way I ended up making this work. I had the message box come up when a user changes the selection, the sheet is unprotected, and a variable I defined in another module (CalcInvalidated) is true. I put that variable in there so that the popup would only show up once, not every time the user changes the selection while the sheet is unprotected.

    Please Login or Register  to view this content.
    Note: booleans are initialized as False as the default.

    Please Login or Register  to view this content.
    Thanks to the other users on here whose posts I worked off of to get this working.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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