Hi expert
here is the code when the column C contains DONE word , then will populate date (today) for adjacent cells for column D . my problem the date will change if I press inside the cells into column C without change word . it should keep old date without change date .
for instance :
cells in column D contain DONE word and date 02/12/2023
and tomorrow should keep DONE word and date 02/12/2023 without any change , but if I try changing NOT YET word to DONE word , then should populate date (today).
here is the code when the column C contains DONE word , then will populate date (today) for adjacent cells for column D . my problem the date will change if I press inside the cells into column C without change word . it should keep old date without change date .
for instance :
cells in column D contain DONE word and date 02/12/2023
and tomorrow should keep DONE word and date 02/12/2023 without any change , but if I try changing NOT YET word to DONE word , then should populate date (today).
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Me.Range("C14:C200")) Is Nothing Then
Dim cell As Range
For Each cell In Application.Intersect(Target, Me.Range("C14:C200"))
If cell.Value = "DONE" Then
cell.Offset(0, 1).Value = Date
ElseIf cell.Value = "NOT YET" Then
cell.Offset(0, 1).ClearContents
End If
Next cell
End If
End Sub