Unlock a cell acording to another cell

  • Hi there


    I am trying to make a sheet that is protected. It's protected in that way that all cells are protected and locked except cell C3. When someone then type anything in cell C3 and leave the cell then cell D3 automatic unlock. I know how to do it with a macro. But I don't want that the user have to press the macro-buttom to unlock cell D3. It should unlock cell D3 automatic.


    Is there someone that can help me with this "small" problem.


    Thank you in advance.


    Regards
    Alring

  • Re: Unlock a cell acording to another cell




    you will need an events macro in the sheet.


    paste this into your sheet / or similar and all should be good



    Code
    Private Sub Worksheet_Change(ByVal Target As Range)
       Dim R As Range
       Set R = Application.Intersect(Target, Range("c3"))
       If R Is Nothing Then Exit Sub
        ActiveSheet.Unprotect
        Range("d3").Select
        Selection.Locked = False
        Selection.FormulaHidden = True
        ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
    End Sub
  • Re: Unlock a cell acording to another cell


    Hi DOC


    Thank you for the help. You have just saved my job. :)


    Thnak you.


    regards
    Mads

  • Re: Unlock a cell acording to another cell


    It's me again.


    I have done what Doc wrote to me. And it's working perfect. I thoght it then was plug and play to do it with the next cells. But it's not. Now i have this code here:


    It will only onlock cell C4. When I then try to wite in Cell C5 then Excel tells me that the cell is protected.


    What am I doing wrong??


    Alring

  • Re: Unlock a cell acording to another cell




    that jobs looking shaky now LOL, 2 secs

    question are these cells empty before you type into them and im guessing the unlock in order ? or thats what you want to happen

  • Re: Unlock a cell acording to another cell


    Hi,


    The cells are empty. I want that the user have to fill in cell C3 before he/she can write in cell C4. And C4 have to filled before they can write in cell C5. And so on and so on.


    Regards
    Alring

  • Re: Unlock a cell acording to another cell


    Sorry I forgot one thing. There will be orther cells on the sheet with text. And I don't want that is't possible for the user to change anything in those cells. That's why all cells have to be locked until the cell above have be filled out. It's not nessesary that the cells that the user have filled out is locked after the cell have be filled out.

  • Re: Unlock a cell acording to another cell


    Quote from alring

    Hi,


    The cells are empty. I want that the user have to fill in cell C3 before he/she can write in cell C4. And C4 have to filled before they can write in cell C5. And so on and so on.


    Regards
    Alring


    well your jobs safe , see above

  • Re: Unlock a cell acording to another cell


    Hi DOC


    Thank you for the help. Now my boss likes me again. You have saved me.


    Thank you so much.


    Regards
    Alring

  • Re: Unlock a cell acording to another cell


    hello , i have a follow up question to this problem....

    the cell range is only C6 long, my question is what if the movement is in column?
    base from the above problem, inputing cell C3 would unlocked C4 but my problem is
    after inputing C3 it should unlocked on cells D3 and inputing D3 should unlocked on E3 and up to c0lumn "BB"

    thanks
    tats

  • Re: Unlock a cell acording to another cell


    Quote from Macropheliac

    Mistaken Thread



    it is okay , anyway i revised my question , hope you read it


    thanks

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!