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
Bookmarks