Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 334
Default Making a time stamp

I need to make a column in a worksheet that will automatically enter the time
and date the info was entered in that row.. I have been playing with the
=NOW() function, but no luck so far.

Thanks!!
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Making a time stamp

Rick,

Copy the code below, right click on the sheet tab, select "View Code", and paste the code into the
window that
appears. You can change the B1:H1000 to a named range, a dynamic range, or any other range that you
want.... this will store the date of the change in column A.

HTH,
Bernie
MS Excel MVP


Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range


If Not Intersect(Target, Range("B1:H1000")) Is Nothing Then
Application.EnableEvents = False
For Each myCell In Intersect(Target, Range("B1:H1000"))
Cells(myCell.Row, 1).Value = Date
Next
End If
Application.EnableEvents = True
End Sub




"Rick" wrote in message
...
I need to make a column in a worksheet that will automatically enter the time
and date the info was entered in that row.. I have been playing with the
=NOW() function, but no luck so far.

Thanks!!



  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 156
Default Making a time stamp

Rick, Bernie's code will work great for you if you want to update the
date/time stamp for a row when you update any cell in that row. If you
don't want that to happen (have an original date/time stamp for when
the info was first entered) then here is Bernie's code modified. This
code will enter a date/time a stamp into column A only if it's blank.
Also, if you'd like the time along with the date, change Date value to
Now in the code and format accordingly.


hope this was helpful
Sandy



Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
If Not Intersect(Target, Range("B1:H1000")) Is Nothing Then
If Cells(Target.Row, 1).Value = Empty Then
Cells(Target.Row, 1).Value = Date
End If
End If
Application.EnableEvents = True
End Sub


Rick wrote:
I need to make a column in a worksheet that will automatically enter the time
and date the info was entered in that row.. I have been playing with the
=NOW() function, but no luck so far.

Thanks!!


  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 334
Default Making a time stamp

Thank you Bernie and Sandy!!!!! I have a use for both sets of code, and this
will help me out tremendously!! Thanks again!!

"Sandy" wrote:

Rick, Bernie's code will work great for you if you want to update the
date/time stamp for a row when you update any cell in that row. If you
don't want that to happen (have an original date/time stamp for when
the info was first entered) then here is Bernie's code modified. This
code will enter a date/time a stamp into column A only if it's blank.
Also, if you'd like the time along with the date, change Date value to
Now in the code and format accordingly.


hope this was helpful
Sandy



Private Sub Worksheet_Change(ByVal Target As Range)
Dim myCell As Range
If Not Intersect(Target, Range("B1:H1000")) Is Nothing Then
If Cells(Target.Row, 1).Value = Empty Then
Cells(Target.Row, 1).Value = Date
End If
End If
Application.EnableEvents = True
End Sub


Rick wrote:
I need to make a column in a worksheet that will automatically enter the time
and date the info was entered in that row.. I have been playing with the
=NOW() function, but no luck so far.

Thanks!!



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
Show time stamp when a value is entered TVCCBJB Excel Discussion (Misc queries) 4 September 8th 06 09:29 PM
Time Stamp Andrew C Excel Worksheet Functions 2 July 27th 06 05:25 AM
formula to determine time range overlap? William DeLeo Excel Discussion (Misc queries) 0 June 6th 06 08:26 PM
How to display seconds on time stamp? uosam Excel Worksheet Functions 1 February 28th 06 09:05 PM
How do i automate a static time stamp? Gavin Taylor Excel Discussion (Misc queries) 1 December 31st 05 02:08 PM


All times are GMT +1. The time now is 02:09 PM.

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"