Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Date Formula

I have a spreadsheet template which has a date cell set up with =Today()
Formula. Simple. The tricky part is I want it so that once I turn the
template into an actual spreadsheet that the next time I open this
spreadsheet to review the data it won't change the date to today's date.

Ways I came up with:

Maybe program the Today formula so that if data is entered into A16 (which
is where data would be entered if spreadsheet was no longer a template) then
don't do Today().

I know there is probably a better way to do this.

Please help! Thank you!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Date Formula

In your routine that changes it from a template to an actual, copy the data
and pastespecial. E.g. A1 contains =TODAY()

Range("A1").Copy
Range("A1").PasteSpecial xlPasteValues

"Steve" wrote:

I have a spreadsheet template which has a date cell set up with =Today()
Formula. Simple. The tricky part is I want it so that once I turn the
template into an actual spreadsheet that the next time I open this
spreadsheet to review the data it won't change the date to today's date.

Ways I came up with:

Maybe program the Today formula so that if data is entered into A16 (which
is where data would be entered if spreadsheet was no longer a template) then
don't do Today().

I know there is probably a better way to do this.

Please help! Thank you!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Date Formula

in the workbook's Open event:-

Option Explicit

Private Sub Workbook_Open()
with worksheets("sheet1").range("A1")
.value = date
.numberformat="dd-mmm-yy"
end with
End Sub

"Steve" wrote in message
...
I have a spreadsheet template which has a date cell set up with =Today()
Formula. Simple. The tricky part is I want it so that once I turn the
template into an actual spreadsheet that the next time I open this
spreadsheet to review the data it won't change the date to today's date.

Ways I came up with:

Maybe program the Today formula so that if data is entered into A16 (which
is where data would be entered if spreadsheet was no longer a template)
then
don't do Today().

I know there is probably a better way to do this.

Please help! Thank you!


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Date Formula

In your routine that changes it from a template to an actual,
copy the data and pastespecial. E.g. A1 contains =TODAY()

Range("A1").Copy
Range("A1").PasteSpecial xlPasteValues


Actually there is a simpler way...

Range("A1").Value = Range("A1").Value

That will overwrite the formula in A1 with the current value being displayed
in A1.

--
Rick (MVP - Excel)

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
Create a formula in a date range to locate a specific date - ecel util Excel Discussion (Misc queries) 0 February 19th 07 03:03 PM
Excel Formula to calulate number of days passed from date to date K. Mack Excel Discussion (Misc queries) 8 January 4th 07 11:27 PM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Worksheet Functions 2 April 21st 06 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Excel Discussion (Misc queries) 1 April 20th 06 10:03 PM
formula to calculate future date from date in cell plus days Chicesq Excel Worksheet Functions 8 November 3rd 05 12:25 PM


All times are GMT +1. The time now is 03:56 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"