what would the VBA be to enter a date in a single cell when a template file is opened and keep that date frozen after it is saved?
If I need to set a condition, maybe something like if A1>0,Now() formatted for just the date.
Printable View
what would the VBA be to enter a date in a single cell when a template file is opened and keep that date frozen after it is saved?
If I need to set a condition, maybe something like if A1>0,Now() formatted for just the date.
.
In the module ThisWorkbook :
Code:Option Explicit
Private Sub Workbook_Open()
If Sheet1.Range("A1").Value > 0 Then
Sheet1.Range("B1").Value = Now()
End If
End Sub