Results 1 to 16 of 16

Conditional cell lock

Threaded View

  1. #2
    Registered User
    Join Date
    05-15-2008
    Posts
    20

    conditional lock

    Hi , I typed in the following code for this problem.But still am not able to get the desired results.Any help from anybody??


    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim Cell As Range
    Dim WS As Worksheet
    Set WS = Target.Parent
    WS.Unprotect
    For Each Cell In Target
        If Cell.Column = 3 Then
            If Cell = "LOCK" Then
                Range(Cells(Cell.Row, 1), Cells(Cell.Row, 7)).Locked = True
            ElseIf Cell = "UNLOCK" Then
                Range(Cells(Cell.Row, 1), Cells(Cell.Row, 7)).Locked = False
            End If
        End If
    Next Cell
    WS.Protect
    End Sub
    Last edited by royUK; 05-29-2008 at 05:21 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