Paste this into the Sheet Level module for the worksheet.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
Set MyRange = Intersect(Range("A1:D100"), Target) '<-- change range of rows here
If Not MyRange Is Nothing Then
Sheets("Sheet1").Unprotect password:="hello" '<-- this is your password, change as required.
MyRange.Locked = True
Sheets("Sheet1").Protect password:="hello"
End If
End Sub