This version allows you to double-click the cell, enter the password, then change the data there in. Keeps you from having to constantly go to the Menu Bar to enter a password.
Code:
Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim PassWord As String, i As Integer
i = 0
Do
i = i + 1
If i > 3 Then
MsgBox "Sorry, Only three tries"
Application.DisplayAlerts = False
ThisWorkbook.Saved = True
Application.Visible = False
Application.Quit
Exit Sub
End If
PassWord = InputBox("Enter Password")
Loop Until PassWord = "password"
If PassWord = "password" Then
Dim cel As Range
ActiveSheet.Unprotect PassWord:="password"
For Each cel In Target
If cel.Value <> "" Then
cel.Locked = True
End If
Next cel
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel As Range
ActiveSheet.Unprotect PassWord:="password"
For Each cel In Target
If cel.Value <> "" Then
cel.Locked = True
End If
Next cel
ActiveSheet.Protect PassWord:="password"
End Sub