View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default excel, automatic date and time when info gets entered

Do you then want that date to be static?

Right-click on the sheet tab and "View Code".

Copy/paste the following event code to that module.

As you enter/edit data in column A, the date/time will be stamped in column B.


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
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:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP

On Wed, 26 Apr 2006 09:09:02 -0700, shorty
wrote:

in excel, i am trying to get the date and time to automatically enter itself
when info is entered in another cell


Gord Dibben MS Excel MVP