Date Formula

S

Steve

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!
 
R

RonaldoOneNil

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
 
P

Patrick Molloy

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
 
R

Rick Rothstein

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.
 

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

Top