Evaluating Today() function only once in a worksheet

G

Guest

Hello,

I've created excel worksheet that auto-populates certain cells with today's
date to facilate filling out a purchase order worksheet.

But problem is once i save the worksheet, and open it at some other date
the Today() function gets executed again a re-populates those cells with
today's date, instead of keeping the original date. HOw can i prevent this
from happening so that when the worksheet is opened at some future day, those
cells will retain the original date.
 
G

Guest

Oops, forgot to add the requirement that i do not want to add any VB code to
the worksheet. ie. I don't want to add VB code to the workbook_open event to
resolve this issue.

Thanks!
 
B

Biff

Hi!

You have 2 options:

1. use VBA code
2. hardcode the date

I can't help with 1.

For 2, you can just enter the date in one cell and link the other date cells
to that one cell.

CTRL ; (semicolon) enters the date.

Biff
 
G

Guest

Thanks for responding gentlemen.

Decided that i had to use a single line of VB code inside the template's
workbook_open method to do the trick:

Private Sub Workbook_Open()
If ThisWorkbook.Path = "" Then Sheet1.Range("Start_Date").Value = Now
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

Top