Insert Date

N

newguy

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
 
G

Gord Dibben

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top