Hi,
I have found the below module which let me lock cells automatically however it lock the cell even if i had press delete by mistake in that cell and cant entered value in it without 1st unprotecting the sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim MyRange As Range
Set MyRange = Intersect(Range("A1:O1000"), Target)
If Not MyRange Is Nothing Then
Sheets("Sheet1").Unprotect Password:="1234"
MyRange.Locked = True
AllowFiltering = True
Sheets("Sheet1").Protect Password:="1234"
End If
End Sub
Note: All Cell have are protected however still data can be entered in them (but even if delete is pressed by mistake it gets locked, whereas it was supposed to be blocked only if some value is entered in them)
thanks for the help
Bookmarks