How to Auto Lock Cell after Data entry in Excel
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim kk As Range
On Error Resume Next
Set kk = Intersect(Range("b3:c12"), Target)
If kk Is Nothing Then Exit Sub
Target.Worksheet.Unprotect Password:="222"
kk.Locked = True
Target.Worksheet.Protect Password:="222"
End Sub
Comments
Post a Comment