This post will guide you how to insert the created date and last modified date of the current workbook in a cell in Excel. How do I insert the date an excel workbook was last modified in a cell. How to insert last modified date in Excel.
Insert Created Date and Last Modified Date in Cells
If you want to check the created date and last modified date of the current workbook, you can go to File tab, and click Info menu and you can get the Last modified date and the created date from the Related Dates section in the Info page.
You can use an Excel VBA macro to insert the created date and the last modified date into a cell. Just do the following steps:
#1 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut.
#2 then the “Visual Basic Editor” window will appear.
#3 click “Insert” ->”Module” to create a new module.
#4 paste the below VBA code into the code window. Then clicking “Save” button.
Sub workbookRelatedDates() Range("A1").Value = Format(ThisWorkbook.BuiltinDocumentProperties("Creation Date"), "short date") Range("A2").Value = Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time"), "short date") End Sub
#5 back to the current worksheet, then run the above excel macro. Click Run button.
#6 let’s see the result.
You can also write a User Defined Function with VBA code to achieve the same result. Just like this:
Function GetLastModified() as Date GetLastModified = ActiveWorkbook.BuiltinDocumentProperties("Last Save Time") End Function Function GetCreatedDate() as Date GetCreatedDate = ActiveWorkbook.BuiltinDocumentProperties("Creation Date") End Function
Type the following formula into blank cells and then press Enter key.