+ Reply to Thread
Results 1 to 2 of 2

VB Relocks non-protected cell

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    VB Relocks non-protected cell

    I used the following vb code to protect the active worksheet with a password and it works. xyz is my example password.

    ActiveSheet.Protect Password:="xyz"
    BUT, I have one cell that is not proctected and when I run this code, it protects all of the cells, even the one that I have formatted as Not Protected.

    Can anyone give me a lift. I think I need a different way of protecting the activesheet.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,524
    Quote Originally Posted by Launchnet
    I used the following vb code to protect the active worksheet with a password and it works. xyz is my example password.

    ActiveSheet.Protect Password:="xyz"
    BUT, I have one cell that is not proctected and when I run this code, it protects all of the cells, even the one that I have formatted as Not Protected.

    Can anyone give me a lift. I think I need a different way of protecting the activesheet.
    Hi,
    I suppose you could use a code before you protect the sheet, but I do not see why the range would lock itself
        Range("B1").Locked = False
    ActiveSheet.Protect Password:="xyz"

+ 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