+ Reply to Thread
Results 1 to 3 of 3

Unlock cell/s dependant upon entry in another cell

Hybrid View

caspollux23 Unlock cell/s dependant upon... 01-03-2010, 06:12 PM
shg Re: Unlock cell/s dependant... 01-03-2010, 07:09 PM
caspollux23 Re: Unlock cell/s dependant... 01-03-2010, 08:23 PM
  1. #1
    Registered User
    Join Date
    01-03-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question Unlock cell/s dependant upon entry in another cell

    I've never dealt with vba before and I'm not even sure if that's correct. I wish to lock a worksheet with two cells left unlocked, when an entry is made in one or other of these two cells I need other cells to become unlocked. I have searched on the web but can only find info about locking worksheets.
    Last edited by caspollux23; 01-06-2010 at 11:55 PM.

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

    Re: Unlock cell/s dependant upon entry in another cell

    Here's an example.

    Open a new workbook, select A1:A10, and unlock the cells.

    Then protect the workbook, allowing selection of unlocked cells only.

    Then right-click the Sheet tab, select View Code, and paste this in the window that opens:
    Private Sub Worksheet_Change(ByVal Target As Range)
        Me.Protect Password:="", UserInterfaceOnly:=True
        With Target
            If .Count = 1 And .Column < Me.Columns.Count Then .Offset(, 1).Locked = False
        End With
    End Sub
    Close all that and go back to Excel.

    You can only select A1:A10. Entering something in one of those cells will unlock the cell to the right; enter something in that cell, and it will unlock the next.

    If you've never used VBA, this might not be the easiest place to start.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-03-2010
    Location
    Canberra, Australia
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Unlock cell/s dependant upon entry in another cell

    shg - thank you for your reply, I have started looking at tutorials to learn about vba but in the meantime the cells I wish to be open are G16 and O16, if a "Y" is entered in G16 then I need G27, G31, G33 and G36 to unlock, each one unlocking the next if necessary. for O16 I need O21, O23, O27, O31, O33 and O36 to unlock. Is this possible?

+ 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