Hi all, I am looking for a VBA code which can lock the rows from column K to P based on any input of the same row's column J.
I would want the row to lock once any info is written in the column J. Do not want it to be specific to a text.
Currently I have:
However, this only locks that particular cell which has value in column J. I would want that row (K to P) to be locked. Cant seem to figure it out. Thanks for the help in advance
I would want the row to lock once any info is written in the column J. Do not want it to be specific to a text.
Currently I have:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const PASSWORD = "PW"
Dim Row As Long
If Target.Column = 10 Then
Target.Parent.Unprotect PASSWORD
Row = Target.Row
Target.Parent.Range("K:P").Locked = True
Target.Parent.Protect PASSWORD
End If
End Sub