You need to set the EnableSelection property. You are probably protecting the
sheet, but still allowing the users to select both locked & unlocked cells. Tru
something like this:
Sub AAAA()
Call ProtectSht("Sheet1")
End Sub
Sub BBBB()
Call UnprotectSht("Sheet1")
End Sub
Private Sub ProtectSht(ShtName As String)
Sheets(ShtName$).Protect
Sheets(ShtName$).EnableSelection = xlNoSelection
End Sub
Private Sub UnprotectSht(ShtName As String)
Sheets(ShtName$).Unprotect
Sheets(ShtName$).EnableSelection = xlNoRestriction
End Sub
For greater security, you could add a password.