View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Time and date each entry

Right click on the sheet tab and select view code.

put in code like this

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count 1 Then Exit Sub
If Target.Column = 3 Then
On Error GoTo errHandler
Application.EnableEvents = False
With Cells(Target.Row, 1)
.Value = Time
.NumberFormat = "hh:mm:ss"
End With
With Cells(Target.Row, 2)
.Value = Date
.NumberFormat = "mm/dd/yyyy"
End With
Columns("A:B").AutoFit
End If
errHandler:
Application.EnableEvents = True
End Sub

If you are not familiar with events, look at Chip Pearson's page
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"MAS" wrote in message
...
Hi,

I am creating a spreadsheet to record and manage IT faults under the
following column headings.

TIME DATE Fault Description Reported By

Reported
To Result

Is there any way to get Excel to generatenew time and date to reflect when
each Fault Description is entered on a new Row ?

Thanks