Question : Date/Time Stamp an Excel Workbook

:  I have an excel template/form that I have others use to track production activities. I want code to insert the current date and time into a cell (doesn't matter which one) when a new form is created and saved. I would also like the cell to be protected so that when someone opens the form to read it the cell maintains the creation date.

Thanks in advance...
Chris

Answer : Date/Time Stamp an Excel Workbook

attached, also realised as the cell is no protected, you must add the following to your code
1:
2:
3:
4:
5:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Sheet1.Unprotect
    Cells(1, 1).Value = Now()
    Sheet1.Protect
End Sub
Open in New Window Select All
 
cell modify on save
 
Random Solutions  
 
programming4us programming4us