Template with date and time stamp

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

Guest

Has anyone created a template where the static date and time will automatically be included in a cell? I know with the NOW() function, the date and time will continually be updated.
 
If you want a static date entered in a cell dynamically (like when a
workbook is initially opened) you'd have to use a macro. For instance you
could put this in the ThisWorkbook module of the template's VB project:

Private Sub Workbook_Open()
If Range("A1").Value = 0 Then Range("A1").Value = Date
End Sub
 

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

Back
Top