ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto date & time (https://www.excelbanter.com/excel-programming/388472-auto-date-time.html)

Jock

Auto date & time
 
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
--
tia

Jock

Turbo[_2_]

Auto date & time
 
On May 1, 5:59 am, 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
--
tia

Jock




Turbo[_2_]

Auto date & time
 
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


Gord Dibben

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



Jock

Auto date & time
 
Brilliant! Thanks very much
--
tia

Jock


"Gord Dibben" wrote:

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




nabanco

Auto date & time
 
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?



"Jock" wrote:

Brilliant! Thanks very much
--
tia

Jock


"Gord Dibben" wrote:

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





All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com