Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default How can I get the system date & time for different cell record

I'm trying to use EXCEL to capture transactions. For each transaction record,
I need to get the notebook system date & time. I use the "Now()" function,
but each time I hit enter all the values in the column changes to the current
date & time values. Is there another function/fomulae?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How can I get the system date & time for different cell record

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H:H" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0, 1).Value = Format(Now, "dd mmm yyy hh:mm:ss")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Get System Date & Time" <Get System Date &
wrote in message ...
I'm trying to use EXCEL to capture transactions. For each transaction
record,
I need to get the notebook system date & time. I use the "Now()" function,
but each time I hit enter all the values in the column changes to the
current
date & time values. Is there another function/fomulae?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default How can I get the system date & time for different cell record

Instead of =NOW() use:

CNTRL-; CNTRL-:
--
Gary''s Student - gsnu200764


"Get System Date & Time" wrote:

I'm trying to use EXCEL to capture transactions. For each transaction record,
I need to get the notebook system date & time. I use the "Now()" function,
but each time I hit enter all the values in the column changes to the current
date & time values. Is there another function/fomulae?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I get the system date & time for different cell record



"Gary''s Student" wrote:

Instead of =NOW() use:

CNTRL-; CNTRL-:
--
Gary''s Student - gsnu200764


"Get System Date & Time" wrote:

Sorry I tried "CNTRL-; CNTRL-:" but it does not work. I must have got it wrong. Please elaborate.


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I get the system date & time for different cell record



"Bob Phillips" wrote:

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H:H" '<== change to suit

On Error GoTo ws_exit
Application.EnableEvents = False

If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
.Offset(0, 1).Value = Format(Now, "dd mmm yyy hh:mm:ss")
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Get System Date & Time"

Thanks Bob for your help but I did not get it to work. I must have done
something wrong.




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How can I get the system date & time for different cell record

Hit and hold the control key
hit the semi-colon key (;)
(you'll see the date entered into the formulabar)
let go of the control key

Hit the space bar

hit and hold the control key
hit the colon key (:)
(you'll see the time added to the formulabar)
let go of the control key

Hit enter to finish.

When you're done, you should see something like:
01/08/2008 09:12:00 AM
in the formulabar

(I use USA date order. Yours may be different.)



Get System Date & Time wrote:

"Gary''s Student" wrote:

Instead of =NOW() use:

CNTRL-; CNTRL-:
--
Gary''s Student - gsnu200764


"Get System Date & Time" wrote:

Sorry I tried "CNTRL-; CNTRL-:" but it does not work. I must have got it wrong. Please elaborate.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I get the system date & time for different cell record



"Dave Peterson" wrote:

Hit and hold the control key
hit the semi-colon key (;)
(you'll see the date entered into the formulabar)
let go of the control key

Hit the space bar

hit and hold the control key
hit the colon key (:)
(you'll see the time added to the formulabar)
let go of the control key

Hit enter to finish.

When you're done, you should see something like:
01/08/2008 09:12:00 AM
in the formulabar

(I use USA date order. Yours may be different.)


Get System Date & Time wrote:

"Gary''s Student" wrote:

Instead of =NOW() use:

CNTRL-; CNTRL-:
--
Gary''s Student - gsnu200764


"Get System Date & Time" wrote:

Sorry I tried "CNTRL-; CNTRL-:" but it does not work. I must have got it wrong. Please elaborate.


--

Dave Peterson

Hi Dave, Thanks I got it to work. Thanks to "gary's Student" as I now
realise what you meant.
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default How can I get the system date & time for different cell record

Be aware though that it only shows hours and minutes, not the seconds.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Get System Date & Time" wrote
in message ...


"Dave Peterson" wrote:

Hit and hold the control key
hit the semi-colon key (;)
(you'll see the date entered into the formulabar)
let go of the control key

Hit the space bar

hit and hold the control key
hit the colon key (:)
(you'll see the time added to the formulabar)
let go of the control key

Hit enter to finish.

When you're done, you should see something like:
01/08/2008 09:12:00 AM
in the formulabar

(I use USA date order. Yours may be different.)


Get System Date & Time wrote:

"Gary''s Student" wrote:

Instead of =NOW() use:

CNTRL-; CNTRL-:
--
Gary''s Student - gsnu200764


"Get System Date & Time" wrote:

Sorry I tried "CNTRL-; CNTRL-:" but it does not work. I must have
got it wrong. Please elaborate.


--

Dave Peterson

Hi Dave, Thanks I got it to work. Thanks to "gary's Student" as I now
realise what you meant.



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default How can I get the system date & time for different cell record



"Bob Phillips" wrote:

Be aware though that it only shows hours and minutes, not the seconds.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Get System Date & Time" wrote
in message ...

Thanks Bob. You are right. hh:mm is fine with me. By the way, Dave, I use a custom format in the cell and was able to display the date in the right format.



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
Formula that will record the time and date when an entry is made on a sheet [email protected] Excel Worksheet Functions 3 October 11th 07 08:28 AM
Record date cell is inputted Marty Excel Discussion (Misc queries) 1 January 23rd 07 08:57 PM
Macro to record user name and date/time Maddoktor Excel Discussion (Misc queries) 0 December 8th 05 10:03 PM
automatically insert system time in a cell PM Excel Discussion (Misc queries) 2 December 30th 04 04:56 PM
How do I get one cell to record the time another cell was changed. Reigning in Seattle Excel Discussion (Misc queries) 1 December 17th 04 07:45 PM


All times are GMT +1. The time now is 02:23 AM.

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

About Us

"It's about Microsoft Excel"