Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Value = "" Then
Exit Sub
Else
Sheets("Sheet1").Unprotect Password:="bob"
Target.Locked = True
Sheets("Sheet1").Protect Password:="bob"
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("A2:A750"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
.Offset(0, -1).ClearContents
Else
With .Offset(0, -1)
.NumberFormat = "ddd. dd mmm yy hh.mm"
.Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub
Sorry to keep making threads, but where do I put these two pieces of code so that they run smoothly alongside each other. The first code is so that only blank cells can be edited.
Bookmarks