Time Stamp

D

doughboy25

Does anyone know how to insert the current time into a cell when data is
entered into another cell?

For example:
When something is entered into A1, B1 will display the time the entry was
made into A1.

I used an if function, with the now function as my true value, but using the
now function gives you a time that is constantly updated when other excel
calculations or entries are made. I don't want the time to change.

Thanks for your help.
Mike
 
J

John Vinson

Does anyone know how to insert the current time into a cell when data is
entered into another cell?

For example:
When something is entered into A1, B1 will display the time the entry was
made into A1.

Please post this question to an Excel newsgroup. This newsgroup is for
a different program, Microsoft Access.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
J

Jamie Collins

doughboy25 said:
Does anyone know how to insert the current time into a cell when data is
entered into another cell?

For example:
When something is entered into A1, B1 will display the time the entry was
made into A1.

Although you can do this for a regular Jet (MS Access) table e.g.

CREATE TABLE MyTest (
MyDataCol CURRENCY NOT NULL,
MyTimestampCol DATETIME DEFAULT NOW() NOT NULL
)
;

an Excel 'table' does not support DEFAULT (nor NOT NULL, come to
that).

You will have to maintain the timestamp yourself e.g.

CREATE TABLE
[Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;].MyXLTest
(
MyDataCol CURRENCY NULL,
MyTimestampCol DATETIME NULL
)
;
INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;].MyXLTest
(MyDataCol, MyTimestampCol) VALUES (38000, NOW())
;
UPDATE
[Excel 8.0;HDR=YES;Database=C:\MyWorkbook.xls;].MyXLTest
SET MyDataCol=42000, MyTimestampCol=NOW()
;

Note the NOW() function is used above to create a *value* rather than
a cell formula i.e. it will not recalculate.

Jamie.

--
 
Top