Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Private Sub Worksheet_Change(ByVal Target As Range)

'Excel 10 Tutorial

Dim xRg As Range

On Error Resume Next

Set xRg = Intersect(Range("A1:b15"), Target)

If xRg Is Nothing Then Exit Sub

Target.Worksheet.Unprotect Password:="1234"

xRg.Locked = True

Target.Worksheet.Protect Password:="1234"

End Sub

You might also like