Automatically entering a date that does not change?

  • Thread starter Thread starter Questioner
  • Start date Start date
Q

Questioner

I created a Purchase Order that automatically inserts the
date "=Today" My question is how can I make so date
remains the same even after subsequent openings of the
document? Any help is greatly appreciated. thanks
 
You would need VBA for that, press Alt + F11, find your workbook in the left
project pane, double click ThisWorkbook and paste in this (or right click
the the excel icon to the left of the file menu
and select view code)

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

Replace A1 with the cell where you want the date stamp, press Alt + Q and
save the workbook
 
Back
Top