Today()


Posted by Jason G on April 18, 2001 1:10 PM

I want to populate a cell with the text returned by Today(), rather than the formula. In other words, once the data is in there, I don't want it to change the next time I open the sheet.

Posted by Mark W. on April 18, 2001 1:18 PM

Ctrl+;

Posted by Ian on April 18, 2001 1:19 PM

Control ; will quickly do that. Courtesy of Dave H.

Posted by Mark W. on April 18, 2001 1:21 PM

...courtesy of Bill Gates : )

Posted by Jason G on April 18, 2001 7:12 PM

Did I forget to mention automatically?

Posted by Dave Hawley on April 18, 2001 9:21 PM


Hi Jason

If you want it to be automatic, place this code in the Workbook_Open module. To get there right click on the sheet picture, top left next to "File" and select "View Code". Then paste in this code and change the sheet and range to suit.

Private Sub Workbook_Open()
If IsDate(Sheet1.Range("A1")) Then
Sheet1.Range("A1") = Sheet1.Range("A1").Value
End If
End Sub

Dave

OzGrid Business Applications



Posted by Jason G on April 20, 2001 5:37 AM

This works..... but,
I have to have that cell protected so people don't change it. When it is locked the code you provided won't run. I get a message saying that the sheet is protected and cannot be changed.