Saturday, December 14, 2019

AUTOMATIC LOCK EXCEL SHEET




AUTOMATIC LOCK
:) :)

by VIkal Jain sir

CODE TO COPY AND PASTE

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
On Error Resume Next
Set xRg = Intersect(Range("A1:E15"), Target)
If xRg Is Nothing Then Exit Sub
Target.Worksheet.Unprotect Password:="1234"
xRg.Locked = True
Target.Worksheet.Protect Password:="1234"
End Sub




Ref: Vlkal Jain

0 comments:

"If you are interested, you'll do what's convenient; if you're committed, you'll do whatever it takes." - John Assaraf"
1 332 333