Auto date & time
Event code.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A3")) Is Nothing Then
With Target
If .Value < "" Then
.Offset(-1, 0).Value = Format(Now, "hh:mm:ss")
.Offset(-2, 0).Value = Format(Date, "dd/mm/yyyy")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub
Right-click on the sheet tab and "View Code"
Copy/paste into that sheet module.
Gord Dibben MS Excel MVP
On Tue, 1 May 2007 04:59:01 -0700, Jock wrote:
When data is entered into A3, I'd like that days date to automatically appear
in A1 and the time of enrty to appear in A2.
What is the easiest way tro achieve this
|