Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Using today formula for a template
I would like to use the =today() formula on a telplate, and have it work for
the first time it is used only. Is there a way. OK to make it clear, if I have this in a template, I would like to open a telplate, have today's dat appear. and when it is saved, I need that date in there perminantly. Thanks in advance. |
#2
|
|||
|
|||
You'll need to do that when you open the template copy.
If the target cell is empty then put today's date in it: Private Sub Workbook_Open() With Worksheets("Sheet1").Range("A1") If .Text = "" Then .Value = Date End If End With End Sub "Mike Busch" wrote: I would like to use the =today() formula on a telplate, and have it work for the first time it is used only. Is there a way. OK to make it clear, if I have this in a template, I would like to open a telplate, have today's dat appear. and when it is saved, I need that date in there perminantly. Thanks in advance. |
#3
|
|||
|
|||
So you are saying that I can not use the =today() formula for the date. If I
did it would keep changing, everytime it was opened. "Duke Carey" wrote: You'll need to do that when you open the template copy. If the target cell is empty then put today's date in it: Private Sub Workbook_Open() With Worksheets("Sheet1").Range("A1") If .Text = "" Then .Value = Date End If End With End Sub "Mike Busch" wrote: I would like to use the =today() formula on a telplate, and have it work for the first time it is used only. Is there a way. OK to make it clear, if I have this in a template, I would like to open a telplate, have today's dat appear. and when it is saved, I need that date in there perminantly. Thanks in advance. |
#4
|
|||
|
|||
That is correct. But it's not a big deal to add the code that runs when you
open a workbook. Press Alt-F11. Press Ctrl-R Find your template in the list, and under the template double-click on This Workbook Paste in the code below, changing Sheet1 to the name of the sheet where you want the date and changing A1 to the address of the cell where you want the date. Save the file "Mike Busch" wrote: So you are saying that I can not use the =today() formula for the date. If I did it would keep changing, everytime it was opened. "Duke Carey" wrote: You'll need to do that when you open the template copy. If the target cell is empty then put today's date in it: Private Sub Workbook_Open() With Worksheets("Sheet1").Range("A1") If .Text = "" Then .Value = Date End If End With End Sub "Mike Busch" wrote: I would like to use the =today() formula on a telplate, and have it work for the first time it is used only. Is there a way. OK to make it clear, if I have this in a template, I would like to open a telplate, have today's dat appear. and when it is saved, I need that date in there perminantly. Thanks in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do you open a template at startup? | Excel Discussion (Misc queries) | |||
Formula to count number of days in range which are less than today | Excel Worksheet Functions | |||
Formula Template | Excel Worksheet Functions | |||
Howdo U copy a formula down a column, that uses data in another w. | Excel Worksheet Functions | |||
revert formula insertion to old method | Setting up and Configuration of Excel |