date entered as time stamp

  • Thread starter Thread starter Jefe
  • Start date Start date
J

Jefe

I have a spreadsheet that I use to keep track of works in
progress. I would like to create a column that date &/or
time stamps when an adjoining cell is updated.

Everything I try results in the time changing every
minute - regardless of changes in the other cell.

Any ideas?
 
Hi Jefe

you have to process the worksheet_change event. E.g.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("A:A")) Is Nothing Then Exit Sub
On Error GoTo errHandler:

Application.EnableEvents = False

With Me.Cells(Target.Row, "B")
If Target.Value = "" Then
'they've emptied the cell
.ClearContents
Else
.Value = Date
.NumberFormat = "mm/dd/yyyy"
End If
End With

errHandler:
Application.EnableEvents = True
End Sub

This will insert the current date in column B if the adjacent cell in
column A is changed. If the cell in column A is deleted, the date in
column B is also deleted

HTH
Frank
 
Jefe

I don't think there is a way to do this with a formula, only with VBA. You
can insert the date or time manually using the shortcuts:

Ctrl ; for date
Ctrl : for time

Andy.
 
Back
Top