Code is here
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
#autolock #dataentry #entryrestricted
Important Links
Our You Tube channel 👍👍
https://www.youtube.com/c/VIKOMINSTITUTE?sub_confirmation=1
Our LinkedIn channel 👍👍
https://www.linkedin.com/in/excel-tricks-vikal-jain-8a011087
Instagram link 👍👍
http://www.instagram.com/tricksexcel
Telegram link 👍👍
t.me/exceltricks1
Excel group links 👍👍
https://www.facebook.com/groups/Tricksexcel
Twitter link 👍👍
https://mobile.twitter.com/Vikal10000
Wanna Paid courses 👍👍
Contact whatsapp +91-9213331108 or email [email protected]