Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 440
Default 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





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Time entry auto changes to date and then time ? Carol @ Prison[_2_] Excel Worksheet Functions 1 November 25th 09 10:01 PM
Auto Date & Time Keyrookie Excel Worksheet Functions 3 November 22nd 08 09:05 PM
Auto insert date/time Tino Excel Worksheet Functions 1 September 8th 06 05:58 PM
Please help with auto Date and Time with VBA Fonz Excel Programming 6 June 10th 06 08:40 AM
Auto insertion of date and time MC[_4_] Excel Programming 8 July 21st 04 03:54 PM


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"