Preventing date from changing

  • Thread starter Thread starter theslaz
  • Start date Start date
T

theslaz

I'm using excel for invoicing purposes. I have it set up so that when I
open the master invoice the date is automatically inserted with the
"Now" command. My problem is that when/if I open this same invoice at a
later date; that original date will change to the current date. I would
like the original date to remain. Is this possible?
 
one way:

Put this in the ThisWorkbook code module:

Public Sub Workbook_Open()
With Sheets(1).Range("A1")
If IsEmpty(.Value) Then
.NumberFormat = "dd mmm yyyy"
.Value = Date
End If
End With
End Sub

Change your sheet/cell reference to suit. Make sure you save the
template with the appropriate cell cleared.
 
Back
Top