+ Reply to Thread
Results 1 to 5 of 5

VBA - Popup message when user selects a Protected Cell

  1. #1
    Registered User
    Join Date
    01-01-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010 (work) & 2013 (home)
    Posts
    45

    VBA - Popup message when user selects a Protected Cell

    Hi All,

    I searched on the forum and found a previous post that matched my situation.

    I'm trying to created a MsgBox with a message when a user tries to edit a protected cell in a workbook (I don't want the default message that Excel produces when you edit a protected cell).

    I've used the following code from a previous post, but can't seem to get it to work:

    Please Login or Register  to view this content.
    Anyone any suggestions?
    Elliot
    The geek shall inherit the earth

  2. #2
    Valued Forum Contributor
    Join Date
    11-20-2012
    Location
    Seattle, WA USA
    MS-Off Ver
    Excel 2010
    Posts
    597

    Re: VBA - Popup message when user selects a Protected Cell

    if you put it into a module then it won't work, you have to put it in the sheet code of the sheet that you want to affect

  3. #3
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: VBA - Popup message when user selects a Protected Cell

    Why not disable the locked cells so the user cannot select them in the first place?

  4. #4
    Registered User
    Join Date
    01-01-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010 (work) & 2013 (home)
    Posts
    45

    Re: VBA - Popup message when user selects a Protected Cell

    Scott - I have placed this in the Sheet code ad not in a module. I have code in the same sheet for button click actions so this is the sheet code isn't it?

    coreytroy - I specifically want a user-defined message as opposed to just protecting the worksheet and having the default Excel pop-up.

  5. #5
    Registered User
    Join Date
    01-01-2013
    Location
    Manchester, England
    MS-Off Ver
    Excel 2010 (work) & 2013 (home)
    Posts
    45

    Re: VBA - Popup message when user selects a Protected Cell

    Apologies all - by some strange wonder - I've gone into my spreadsheet this morning and it's working just fine

    Modified it slightly - specifying the locked cell range as opposed to the user-editable range - and also adding in an action to Undo and put the formula back:

    Please Login or Register  to view this content.
    Last edited by elliotencore; 06-27-2013 at 04:39 AM.

+ 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