Results 1 to 6 of 6

Thread: [RESOLVED] excel protection question

  1. #1

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Resolved [RESOLVED] excel protection question

    If a sheet is protected, is it possible to disable selection / activation of locked cells?
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  2. #2
    Hyperactive Member
    Join Date
    Jul 2005
    Posts
    490

    Re: excel protection question

    first unprotect sheet

    then format>sheet>unhide

    for unprotecting sheet loads of code available ..use google.

  3. #3

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: excel protection question

    Quote Originally Posted by indiewolf
    first unprotect sheet

    then format>sheet>unhide

    for unprotecting sheet loads of code available ..use google.
    Not sure what you mean. Are you referring to the format menu? The sheet is not hidden. As for unprotecting the sheet, I've got the line of code to do that.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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

    Re: excel protection question

    To only allow the use to select/activate unlocked cells, use the EnableSelection property of the sheet before you cal the Protect method.
    VB Code:
    1. With ThisWorkbook.Worksheets(1)
    2.         .EnableSelection = xlUnlockedCells
    3.         .Protect Password:="declan"
    4.     End With
    Declan

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

  5. #5

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: excel protection question

    Quote Originally Posted by DKenny
    To only allow the use to select/activate unlocked cells, use the EnableSelection property of the sheet before you cal the Protect method.
    VB Code:
    1. With ThisWorkbook.Worksheets(1)
    2.         .EnableSelection = xlUnlockedCells
    3.         .Protect Password:="declan"
    4.     End With
    Thanks, do you know if this is going to work for Excel versions older than 2000 as well? I can't test it at the moment.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

  6. #6

    Thread Starter
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573

    Re: [RESOLVED] excel protection question

    I've just tested it under Win98 / Excel 97 and it does work, so you can't disable locked cell selection by means of the Protect -> Sheet menu, but your code does the job.

    Thanks again, DK.
    Lottery is a tax on people who are bad at maths
    If only mosquitoes sucked fat instead of blood...
    To do is to be (Descartes). To be is to do (Sartre). To be do be do (Sinatra)

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