Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Mike Busch
 
Posts: n/a
Default 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   Report Post  
Duke Carey
 
Posts: n/a
Default

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   Report Post  
Mike Busch
 
Posts: n/a
Default

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   Report Post  
Duke Carey
 
Posts: n/a
Default

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you open a template at startup? James Kendall Excel Discussion (Misc queries) 7 July 26th 05 07:33 PM
Formula to count number of days in range which are less than today zooming Excel Worksheet Functions 2 June 21st 05 04:01 PM
Formula Template Carole O Excel Worksheet Functions 0 March 24th 05 06:59 PM
Howdo U copy a formula down a column, that uses data in another w. Need Help pasting a formula Excel Worksheet Functions 1 February 25th 05 06:04 PM
revert formula insertion to old method Don't be a pain in the ass Setting up and Configuration of Excel 0 January 24th 05 01:49 PM


All times are GMT +1. The time now is 03:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"