formula to show time that data was entered on spreadsheet

I

Irmatwit

I want to know if its possible for the time to automatically appear in a
seperate cell when data is entered in a cell. For example, in cell A1 i
enter the figure 3, in cell A2 the time i entered that number appears as
hh.mm.ss. In cell B1 i enter the figure 4 & in cell B2 the time appears
again in hh.mm.ss.

Is this possible and how do i achieve it please. Thank you in advance
 
M

Mike H

Hi,

You need a macro for that but it's easy. Right click your sheet tab, view
code and paste the code below in on the right and that's it. Close VB editor

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("1:1")) Is Nothing Then
On Error Resume Next
Application.EnableEvents = False
Target.Offset(1) = Format(Time, "hh:mm:ss")
Application.EnableEvents = True
On Error GoTo 0
End If
End Sub


Mike
 

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