View Single Post
  #5   Report Post  
tjtjjtjt
 
Posts: n/a
Default

You could use an Event Procedure. I put this into the template's workbook code.
Right click on the Excel icon to the left of the File Menu. Pick View Code.
Change the drop-down on the left to Workbook. Make sure Private Sub
Workbook_Open() shows on the right drop-down.

You should change A1 to whatever cell you want the date to appear in. This
macro will insert the current date into the cell specified for every file
created from the template, unless there is something else in the cell
already. This should stop the date from changing if you open the file up in
the future...as long as you never delete the date.

Private Sub Workbook_Open()
Dim x As Range
Set x = Range("A1")

If x.Value = "" Then x.Value = Date
End Sub

--
tj


"- ML -" wrote:

I've created a lovely invoice in Excel for my company. When I generate a new
invoice from the template it puts in the date using the TODAY() function, but
unfortunately this updates if I ever open the invoice again to look at it.

In Word there is a "CREATEDATE" function which inserts the date that the
file was created first, and never after does it change. Is there any way to
accomplish this same task in Excel?

Thanks,
Michael
mleenheer @ yahoo.com