=TODAY()

  • Thread starter Thread starter Amy
  • Start date Start date
A

Amy

If I use this in a template, how can I get it to save the correct day's date
each time? Do I have to copy, paste special - values?
 
CTRL-; (Control semicolon) enters today's date as a fixed number

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| If I use this in a template, how can I get it to save the correct day's date
| each time? Do I have to copy, paste special - values?
 
Yes.

OR enter the date using CTRL + semi-colon to get a static date.

OR code the date as static when you save the file.


Gord Dibben MS Excel MVP
 
Thanks, but is there a formula that I can use so the users of my template
never have to enter a date?

AS
 
Amy

See John McGimpsey's site for a non VBA approach using a circular reference.

http://www.mcgimpsey.com/excel/timestamp.html

Would your users object to having event code add a static date when the workbook
is opened?

Is your template a true template file? As in template.xlt?

You could add this code to Thisworkbook module in your Template.xlt file

Private Sub Workbook_Open()
With Sheets("Sheet1").Range("A1")
If .Value = "" Then
.Value = Format(Now, "ddmmmyy")
End If
End With
End Sub

Whenever a new book is created from your template, the date will be entered in
A1 of Sheet1.

When you save that book as template1.xls, the date will be frozen.


Gord
 
This actually puts a value into the cell and excel may change the format to
something it likes better.

This may be better:

Option Explicit
Private Sub Workbook_Open()
With Sheets("Sheet1").Range("A1")
If .Value = "" Then
.value = date 'doesn't include the time
.numberformat = "ddmmmyy"
end if
End With
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

Back
Top