Forum Discussion
Autolocking a table
Untested ... hope it works :))
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect Password:="xyz"
Target.Locked = True
With ActiveSheet
.Protect userinterfaceonly:=True, Password:="xyz", AllowInsertingColumns:=True, AllowInsertingRows:=True
.EnableOutlining = True
.EnableAutoFilter = True
End With
End Sub
NikolinoDE
Thanks for your reply.
But its not working, Please refer to the attached workbook
- NikolinoDENov 13, 2021Platinum Contributor
Hope I was able to help you with these sample files 🙂.
NikolinoDE
I know I don't know anything (Socrates)
- yugal40Nov 13, 2021Brass Contributor
NikolinoDE Thanks again for helping me,
The concern here is i want tonly freshly cells to be auto locked and in the attached workbook when i added C6 and C7 cell it worked, But after that it didn't worked for cell C8
Can you please check if the same is happening with you as well?
I am using Office 365 with windows, Not sure if that matters
Thanks- NikolinoDENov 13, 2021Platinum Contributor
So it works for me. If I enter a value in cell, it locks immediately afterwards.
Maybe another user can try it here in the forum and give us feedback?
Tried with another Excel / Pc?
In the end maybe update everything and do an office repair.
*I tested the file with Excel 2016.
Hope I was able to help you with this info.