EDIT: Please Edit your post above and put the code in code tags, like I do here:
---------------------
1) Unlock the cells in columns B and C where the user will enter data.
2) Protect the sheet with a password
3) Use this in the sheet module:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
Select Case Target.Column
Case 2 To 3
Application.EnableEvents = False
If Not IsDate(Cells(Target.Row, "a").Value) Then
Cells(Target.Row, "a").Value = Now()
End If
If IsEmpty(Target) Then Target.Offset(0, -1).ClearContents
Application.EnableEvents = True
End Select
End Sub
Private Sub Worksheet_Activate()
Me.Protect "password", UserInterfaceOnly:=True
End Sub
Obviously you'll need to edit the second macro to have your password, and you may need to tweak the additional parameters so the sheet is protected with the features you want. I'm just showing you how to add the hidden parameter UserInterfaceOnly which allows macros to work on a protected sheet in protected cells even though the user can't.
Bookmarks