Auto date & time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Hi, I have the same question. The twist I have is to keep the date as
a value vs. a formula so it will not update the next time I open the
work sheet. Thx Turbo
 
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
 
Brilliant! Thanks very much
--
tia

Jock


Gord Dibben said:
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
 
Gord,

How would you modify the below to put the date in column A if data is
entered into column B? For the entire sheet. In other words, I type in B16
and the date auto populates into A16 in a 07/07/07 format?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top