What is the command to insert the current date into a cell?

P

Paul

There must be some command that calls the current date into a cell if the
neighboring cell is filled with information. I know the call for current date
can be done with CTRL+; but I want to use it in a formula.
Thanks in advance for your help.
Paul
 
M

Myrna Larson

PS: Both of those formulas are "volatile" and will recalculate to show the
current date/time whenever you recalculate the worksheet.
 
P

Paul B

Paul, you could also try this in B1 for data in A1

=IF(A1="","",IF(B1="",NOW(),B1))
Turn on iteration under tools>options>calculation>iteration

if you want a macro try something like this,

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
With Target
.Offset(, 1).Value = Now
.Offset(, 1).NumberFormat = "m/d/yy h:mm:ss AM/PM"
End With
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 2003
** remove news from my email address to reply by email **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top