Hello
I have had some excellent help setting up the attached file with code that locks the cells in the range after input. This works as intended (example B9).....except for an instance where the user does not input anything and presses other keys like the delete key (example C9) This results in the cell being locked even though there was nothing inputted in the cell. Subsequently nothing can be inputted in that cell until the admin unlocks. is there a way to modify the code to prevent this issue
(Ideally the best case scenario would be to lock only if the cell above has passed the data verification for that cell )
The current code is below
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("b9:h9, b12:h12, b19:h19, b21:h21, b31:h31")) Is Nothing Then Exit Sub
ActiveSheet.Unprotect Password:="cream"
Target.Locked = True
ActiveSheet.Protect Password:="cream"
End Sub
Bookmarks