+ Reply to Thread
Results 1 to 5 of 5

Checkboxes and Sheet Protection error

  1. #1
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Checkboxes and Sheet Protection error

    Hey folks,

    I have the following checkbox on a sheet that is protected but users have the ability to do the following:
    • Select locked cells
    • Select unlocked cells

    I then have the following code associated to a checkbox:


    Please Login or Register  to view this content.

    I have a couple of concerns:
    1. The Protect and Unprotect that I have put in place for the "On" case seems very redundant - is there a better way of doing this?
    2. On the "Off" case I keep getting a Read-Only Error on the range "Range("Zone1_SongInterval_Warning").ClearContents" and I can't figure out why that is the case when I have Unprotected the sheet at the beginning of the "Off" case.

    Any help would be greatly appreciated.
    Last edited by LampCommandr; 04-14-2011 at 02:02 PM.

  2. #2
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Checkboxes and Sheet Protection error

    This should work as far as the redundent unprotect/protect statements. I am not sure why you would be having an isse with the .ClearContents, other than maybe the name is typed in wrong or something. Check the name formula. Maybe it is referencing something that ios not on this sheet.

    Please Login or Register  to view this content.
    Last edited by Whizbang; 04-14-2011 at 11:55 AM.

  3. #3
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Checkboxes and Sheet Protection error

    That is what I had, however I think that what I have on the Worksheet_Change is causing some conflict.

    Here is an example of what I have for the corresponding Zone 1:

    Please Login or Register  to view this content.

    Could this be what is causing the error?

    Also, the named range should not be a problem as this works fine if the Protect/Unprotect is commented out and I'm working with an unprotected workbook.

  4. #4
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Checkboxes and Sheet Protection error

    I would turn off events, then. Since you can trust your code to enter appropriate values at the appropriate times, you don't generally need to validate them.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-12-2010
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    42

    Re: Checkboxes and Sheet Protection error

    Perfect!... and considerably faster. Thanks!

+ 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