Results 1 to 6 of 6

Thread: Locking cell...

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Locking cell...

    hi guys!!! i have a question, how can i locked the sheet with only 'select unlocked cells' enabled. at present i only have this code which locked and unlocked sheet but with 'select locked cells' and 'select unlocked cells' enabled..but i only want 'select unlocked cells' enabled. thanks in advance!!!
    VB Code:
    1. Sheet1.Unprotect ("bcmd")
    2. Sheet1.Protect ("bcmd")

  2. #2
    Frenzied Member DKenny's Avatar
    Join Date
    Sep 2005
    Location
    on the good ship oblivion..
    Posts
    1,171

    Re: Locking cell...

    VB Code:
    1. Sheet1.Protect ("bcmd")
    2.     Sheet1.EnableSelection = xlUnlockedCells
    Declan

    Don't forget to mark your Thread as resolved.
    Take a moment to rate posts that you think are helpful

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Locking cell...

    Thanks a bunch!!! DKenny!

  4. #4

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Locking cell...

    wait..i still have a problem...i've already try your code and it works but when I save my excel document and close it and open it again the cells that are locked is can be selected again..why is that so? I dont want locked cells to be selected. thanks in advance!

  5. #5
    Addicted Member malik641's Avatar
    Join Date
    Sep 2005
    Location
    South Florida :-)
    Posts
    221

    Re: Locking cell...

    Just put DKenny's code in the "ThisWorkbook" module in an open event:

    VB Code:
    1. Private Sub Workbook_Open()




    If you find any of my posts of good help, please rate it

  6. #6

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: Locking cell...

    is there any other solution aside from putting it from
    VB Code:
    1. Private Sub Workbook_Open()
    ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width