Automatically entering a date that does not change?

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
 
P

Peo Sjoblom

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
 

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