Date Formula
Automatically......only by code.
Manually, first time opened, select a cell and CTRL + ;
Workbook_Open code that runs only if a cell is blank.
Private Sub Workbook_Open()
With Sheets("Sheet1").Range("A1")
If .Value = "" Then
..Value = Format(Now, "mm/dd/yyyy hh:mm:ss")
End If
End With
End Sub
Of course the workbook has to be opened at least once in order to add the code
to Thisworkbook module and saved.
Next time opened, date added to A1 but not on subsequent openings.
Gord Dibben MS Excel MVP
On Wed, 30 Apr 2008 13:19:00 -0700, Ronnie
wrote:
Is there a way to have a date automatically inserted the first time a
document is opened and then not again?
|