How do I get the date when text is typed

Microsoft Excel 2007
September 17, 2009 at 10:51:26
Specs: Windows Vista
How do I make it so if data is inputted into one cell then another cell produces the date. So... if A1 has any data B1 will show the current date. I do not want the date to change everyday or every time the document is opened in Excel 2007

See More: How do I get the date when text is typed

Report •


#1
September 17, 2009 at 11:07:55
=IF(A1<>"",NOW(),"")

Report •

#2
September 18, 2009 at 04:48:41
This formual worked but when I opened the document this morning the date changed from yesteday's date to today's. I want the date entered when text is entered not to change. Is there a way to have the date come up but not change everytime the document is opened?


I truly appreciate your response yesterday


Report •

#3
September 18, 2009 at 05:17:55
I guess you confused me with this line:

So... if A1 has any data B1 will show the current date.

Current to me meant current at all times.

Anyway...

To place the date (and time) automatically when the cell is changed, but not have it change when you open the file, you have to use a Change Event macro.

Whenever A1 is changed this code will put the value of Now() in the cell, instead of the ever-changing NOW() function.

Private Sub Worksheet_Change(ByVal Target As Range)
 If Target.Address = "$A$1" Then Range("B1") = Now()
End Sub

Right-click the sheet tab, choose View Code and paste this in the window that opens.


Report •

Related Solutions

#4
September 19, 2009 at 03:24:18
Thanks. This is useful.

Report •


Ask Question