ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do i auto insert a date and time stamp (https://www.excelbanter.com/excel-discussion-misc-queries/129143-how-do-i-auto-insert-date-time-stamp.html)

cjensen

how do i auto insert a date and time stamp
 
I would like to know how to have excel aotomaticaly insert the date and tim
if the adjacent cell is in use. I need the date and time to reflect the time
that the entry was made and not change

Gary''s Student

how do i auto insert a date and time stamp
 
Enter the following macro in WorkSheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Offset(0, 1).Value = Now()
Application.EnableEvents = True
End Sub

If you are not familiar with VBA, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary's Student
gsnu200703


"cjensen" wrote:

I would like to know how to have excel aotomaticaly insert the date and tim
if the adjacent cell is in use. I need the date and time to reflect the time
that the entry was made and not change


JE McGimpsey

how do i auto insert a date and time stamp
 
See

http://www.mcgimpsey.com/excel/timestamp.html

In article ,
cjensen wrote:

I would like to know how to have excel aotomaticaly insert the date and tim
if the adjacent cell is in use. I need the date and time to reflect the time
that the entry was made and not change


David McRitchie

how do i auto insert a date and time stamp
 
Couple of items with this question and suggestion.
The question was answered exactly as asked, but you probably
want to put the datetimestamp into a specific column
and not haphazardly next to any cell that has data entered into it,
perhaps column C when column B is filled in. So it
needs to check that the current (target) cell is in column 2
and probably that it is not row 1. Since John also answered
you would be able to see such things in his code.

My page on getstarted.htm is for regular macros there is
a link right at the top for event macros which is what that code
is and that page is
http://www.mvps.org/dmcritchie/excel/event.htm

But you picked up on one important item and that is to turn of
Event checking when changing the cells with a change event
macro. If there is a problem with the macro the event checking
has to be reenabled when is described near the end of the above
http://www.mvps.org/dmcritchie/excel/event.htm#problems
I don't normally mention that when I send people to event.htm
but it can be a problem.

---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Gary''s Student" wrote in message
...
Enter the following macro in WorkSheet code:

Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Target.Offset(0, 1).Value = Now()
Application.EnableEvents = True
End Sub

If you are not familiar with VBA, see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary's Student
gsnu200703


"cjensen" wrote:

I would like to know how to have excel automaticaly insert the date and time
if the adjacent cell is in use. I need the date and time to reflect the time
that the entry was made and not change





All times are GMT +1. The time now is 11:19 AM.

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