Put date and time in cell

amna77

Active Member
Joined
May 9, 2002
Messages
251
Hi, On my spread sheet, I have 2 cells, in cell A1, people enter names in there, and in cell A2, date and time should come up.
so basacilly what I want to do is, when ever person enters name in the cell A1, then in cell A2, I want to place current date and time.
Is it possible.
Thanks in advance
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
On 2002-10-23 08:20, amna77 wrote:
Hi, On my spread sheet, I have 2 cells, in cell A1, people enter names in there, and in cell A2, date and time should come up.
so basacilly what I want to do is, when ever person enters name in the cell A1, then in cell A2, I want to place current date and time.
Is it possible.
Thanks in advance

This is possible using the sheetchange event...

In the ThisWorkbook module paste the following code. :)

Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)

If Target.Column = 1 Then
    rw = Target.Row - 1
    Range("B1").Offset(rw, 0).Value = Format(Now(), "dd/mm/yy hh:mm")
End If
End Sub
 
Upvote 0
In cell A2, enter the following formula:

=IF(A1>0,TODAY(),"")

(If the entry in cell A1 is greater than zero, place today's date in cell A2, else, nothing.)

Then, format cell A2 to whatever date/time format you want.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,572
Members
448,972
Latest member
Shantanu2024

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top