View Single Post
 
Old 03-26-2017, 03:36 PM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

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
Reply With Quote