Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
SetDateRow Target, "D"
End Sub
Sub SetDateRow(Target As Range, Col As String)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, Col) = Int(Now())
Application.EnableEvents = True
End Sub
Sub SetDateCol(Target As Range, Rw As Long)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Cells(Rw, Target.Column) = Now()
Application.EnableEvents = True
End Sub
|