Automatic time stamp

  • Thread starter Thread starter Da Mann
  • Start date Start date
D

Da Mann

I was wondering if there's a way to add an automatic time stamp. What I'd
like to do is to add a timestamp to a cell (say, B1) when an entry is made a
seperate cell (say A1). Anyone have any ideas? My research, thus far, has
been fruitless.

Thank you!
 
This code placed in a worksheet module will do as requested.

Right-click on your sheet tab and select "View Code". Copy/paste this code
into that module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Now
End If
End If
enditall:
End Sub

Format Column B cells to time.

Note: the time stamp in B is non-volatile(will not change) unless you go back
and edit a value in column A.

Gord Dibben XL2002
 
Right click on the sheet tab and select view code.

Paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Count > 1 Then Exit Sub
If Target.Column = 1 Then
If Target.Value = "" Then Exit Sub
Target.Offset(0, 1).Value = Now
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy hh:mm"
Columns(2).AutoFit
End If
End Sub
 
What is the procedure to create a formula to automatically engage Excel from
a dormant state? Such as first thing in the morning..
 
Back
Top