how do i auto insert a date and time stamp

C

cjensen

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
 
D

David McRitchie

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.
 
Top