+ Reply to Thread
Results 1 to 3 of 3

lock cells until one cell is filled

Hybrid View

  1. #1
    Debbie
    Guest

    lock cells until one cell is filled

    I would like to lock a sheet so no information can be filled in any cells
    until a certain cell has information selected. Is there a way to do that?

  2. #2
    Forum Contributor colofnature's Avatar
    Join Date
    05-11-2006
    Location
    -
    MS-Off Ver
    -
    Posts
    301
    In the Worksheet's code area put in:

    Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    If [a1].Value = Empty Then
    Cells.Locked = True
    [a1].Locked = False
    ActiveSheet.Protect password:="whatever"
    Else
    ActiveSheet.Unprotect password:="whatever"
    End If
    End Sub

    Change the password to something meaningful, change a1's to whichever cell you want the initial data in, uncheck the Locked property of the cell, protect the worksheet and hey presto!

  3. #3
    Debbie
    Guest

    Re: lock cells until one cell is filled

    Thanks colofnature but this didn't work.
    I have a project estimate sheet I'm working on.
    I have all but a handful of cells locked.
    What I want it to do is lock the unlocked cells until cell "c4" has
    information in it.
    That way my users are forced to enter something here.
    Right now, it's hit and miss whether they fill in that blank.
    When I used the formula you gave me it allowed me to continue to fill in the
    blanks regardless of information being entered into cell "c4".

    Thanks,

    Debbie



    "colofnature" wrote:

    >
    > In the Worksheet's code area put in:
    >
    > Private Sub Worksheet_Change(ByVal Target As Excel.Range)
    > If [a1].Value = Empty Then
    > Cells.Locked = True
    > [a1].Locked = False
    > ActiveSheet.Protect password:="whatever"
    > Else
    > ActiveSheet.Unprotect password:="whatever"
    > End If
    > End Sub
    >
    > Change the password to something meaningful, change a1's to whichever
    > cell you want the initial data in, uncheck the Locked property of the
    > cell, protect the worksheet and hey presto!
    >
    >
    > --
    > colofnature
    > ------------------------------------------------------------------------
    > colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
    > View this thread: http://www.excelforum.com/showthread...hreadid=544785
    >
    >


+ 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