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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

s-o-s

Active Member
Joined
Apr 14, 2002
Messages
384
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
 

Barry Katcher

Well-known Member
Joined
Feb 25, 2002
Messages
4,053
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.
 

Forum statistics

Threads
1,148,189
Messages
5,745,238
Members
423,936
Latest member
Conservatopia

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
Top