Data Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can a Data Form field be automatically populated with current date? Tying to
avoid having users type in this field for every row entered.
 
Steve,

Copy the code below, right click the sheet tab, select "View Code" and paste the code into the
window that appears.

This code will put the date into column A of any row where data is entered IF that cell is currently
blank.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Cells(Target.Row, 1).Value <> "" Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, 1).Value = Date
Application.EnableEvents = True
End Sub
 
I appreciate the response very much Bernie. However this would appear to work
for a worksheet. I am attempting to get the date into a dataform that is to
be populated and can't enter a formula directly into the form. The worksheet
is only populated when Enter is pressed but the date would have already been
entered into the dataform.
 
Back
Top