mrcaglayan
New Member
- Joined
- Jan 4, 2024
- Messages
- 6
- Office Version
- 365
- Platform
- Windows
I found this code, but here K:P range is locked when J is anything. I want this code to work ( lock the row ) when the J is a specific text value. Any help much appreciated. Thank you.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const PWORD = "PW"
With Target.Parent
If Target.Column = 10 Then
.Unprotect PWORD
Intersect(Target.EntireRow, .Range("K:P")).Locked = True
.Protect PWORD
End If
End With
End Sub
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Const PWORD = "PW"
With Target.Parent
If Target.Column = 10 Then
.Unprotect PWORD
Intersect(Target.EntireRow, .Range("K:P")).Locked = True
.Protect PWORD
End If
End With
End Sub