Insert Created Date and Last Modified Date in Cells

,

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.

insert created date and last modified date1

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.

Get the position of the nth using excel vba1

#2 then the “Visual Basic Editor” window will appear.

#3 click “Insert” ->”Module” to create a new module.

convert column number to letter3

#4 paste the below VBA code into the code window. Then clicking “Save” button.

insert created date and last modified date2

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.

insert created date and last modified date3

#6 let’s see the result.

insert created date and last modified date4

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

insert created date and last modified date7

Type the following formula into blank cells and then press Enter key.

=GetLastModified()

insert created date and last modified date5

=GetCreatedDate()

insert created date and last modified date6

Leave a Reply