Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a date in file that is constant 2

Status
Not open for further replies.

Dan01

Programmer
Jun 14, 2001
439
US
When using Now() or other date/time functions, the Excel sheet will continuously update the date, thus losing the original date file was created. Is there a way to create a date with Now() and then make it permanent. Thanks Dan.
 
Hi Dan

Given this is the VBA forum the following will do the trick
Code:
[A1] = Format(Now(), "dd/mm/yyyy")

Otherwise you'll have to copy the formula and then paste the value back into the same cell.

Happy Friday
;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Why not store the date in a variable and use the variable:
Code:
Dim theDate As Date

theDate = Now()
Clive [infinity]
 
Hi Loomah and Clive,
will the original date remain one week later? Dan.
 
Hi Dan
If you use the code I suggested or apply the variable Clive suggested to a cell it appears as a date, not as a formula.

The date will still be there tomorrow, next week or next year if noone types over it!

Happy Fiday
;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
And on a non VBA tip, you can use
CTRL + ;
to enter the current date (Static)
and
CTRL + SHIFT + ;
to enter the current time (Static)
Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
Geoff, does that work in Excel? Dan.
 
To answer that for xlbo, yes

follow the yellowbrick road and find more of these keyboard shortcuts from thread68-463686 !!!!!!!!

happy fried hay
;-) If a man says something and there are no women there to hear him, is he still wrong? [ponder]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top