Results 1 to 10 of 10

lock/unlock cell based on another cells input

Threaded View

  1. #6
    Forum Contributor
    Join Date
    01-05-2009
    Location
    South Dakota, USA
    MS-Off Ver
    365
    Posts
    152

    Re: lock/unlock cell based on another cells input

    I tried DonkeyOte's idea and it worked but not quite like I wanted it to.

    When I tried royUK's code I come up with a compile error: Ambiguous name detected: Worksheet_SelectionChange

    here is the code that I have
    [Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Const PW   As String = "secret"
        If Target.Address = "$G$12" Then
            Select Case Cells(7, 8).Value
                Case "Grass Fire", "Timber Fire"
                    ActiveSheet.Unprotect PW
                    Target.Locked = False
                    ActiveSheet.Protect PW
            End Select
            End If
    End Sub]
    Last edited by royUK; 02-26-2009 at 03:08 AM.

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