Auto insert date problem (TODAY() or NOW())

  • Thread starter Thread starter promethious
  • Start date Start date
P

promethious

How do I get Excel to automaticaly put today's date and/or time into
cell so that if the document gets opened on a later date it does no
change to that day and time?

Is this possible by using a template and some sort of macro or VBA
 
One way

Private Sub Workbook_Open()
If Range("A1") = IsEmpty(True) Then
Range("A1") = Now()
Range("A1").NumberFormat = "mm/dd/yyyy"
Else: Exit Sub
End If
End Sub


right click the excel icon next to the file menu and select vies code
paste in the above and press alt + q to close the VBA editor, then
save the workbook
 
Back
Top