+ Reply to Thread
Results 1 to 11 of 11

Protection

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Lightbulb Protection

    Hey folks,
    I've useing the below code to protect my worksheets.
    HOwever, its not working exactly as I would like.
    As it is, it is still possible to delete content from protected cells.

    Can anyone advise what change I need to make?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    Just to be more specific.
    I need it so the cells can be selected and the contents can be copied, but it is not possible to delete or edit the content.

    Thanks

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    Can anybody offer any advice on this?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Protection

    Please Login or Register  to view this content.
    From the comment, locked should be set True
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    Hey shg,
    Thanks for advice. Unfortunately, if I set the range to 'Locked = True', this means that I cannot select or copy the information from these cells, which is the problem Im facing.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Protection

    What is x2NoSelection? I think you meant xlNoSelection (note that's an L not a 1)

    Also, are you getting an error message? If you have no blank cells in the the usedrange intersecting your range that you try to do SpecialCells on, you'll get an error and your error handler will come up with an incorrect message.
    Remember what the dormouse said
    Feed your head

  7. #7
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    The range I am trying this on is below. There are empty cells within this range and yes, its my Error handeler that is cropping up on me.

    Please Login or Register  to view this content.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Protection

    I suggest you change the error message to
    Please Login or Register  to view this content.
    temporarily so that you can determine the real error.

  9. #9
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    Ok, When attempting to make the below change.

    Please Login or Register  to view this content.
    I get the error message.
    'Unable to set ClearContents property of the range class'

    Maybe Im doing somthing completely stupid here, but Im just trying to figure a way so that the cells in that range can be selected and copied but not edited or deleted.

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Protection

    ClearContents is not a property:
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: Protection

    Ah I see, thanks.

    I've just been looking through the help files trying to figure this out and I just taught Id try that.

    Would you have any suggestions as to a solution?

+ 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