Thread: Insert Date
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Insert Date

There is no simple worksheet function/formula that will do this and keep the
date/time static.

You need event code.

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
If Target.Value < "" Then
Target.Offset(0, 1).Value = Now
End If
End If
enditall:
Application.EnableEvents = True
End Sub

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

Copy/paste the code into that sheet module.

Alt + q to return to the Excel window.

Enter something in any cell in column A to get a static date/time entered in
column B


Gord Dibben MS Excel MVP

On Tue, 13 Jan 2009 04:54:46 -0800 (PST), newguy wrote:

I am trying to figure out a simple formula that when a user inserts
his initials into a cell the cell next to it gets the date
corresponding to the day he filled out his initials. This is what I
have

=IF(ISBLANK(D6),"",Date)

Thanks