PDA

View Full Version : VBA Time Stamp for single cell entry



markstro
10-21-2020, 03:10 PM
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.

Logit
10-22-2020, 09:08 AM
.
In the module ThisWorkbook :


Option Explicit

Private Sub Workbook_Open()
If Sheet1.Range("A1").Value > 0 Then
Sheet1.Range("B1").Value = Now()
End If
End Sub