Skip to main content

Get and insert the created time and last modified time in cells

This article will talk about ways to get the created time and last modified time of current workbook information, and insert the created time and last modified time of current workbook information in cells in Excel.

Get the created time and last modified time in Excel with Info command

Get the created time and last modified time in Excel with Advanced Properties function

Insert the created time and last modified time in cells in Excel with VBA code

Insert the created time and last modified time in cells/header/footer with Kutools for Excel good idea3


arrow blue right bubble Get the created time and last modified time in Excel with Info command

We can find out the exact created time and last modified time of current workbook in backstage view of Microsoft Excel 2010 / 2013.

Click the File > Info, and in the right side of backstage view it displays the Related Dates information. Under the Related Dates title, it lists the last modified time, created time, and last printed time. See following screenshot:

-2

 

Note: This way is only available in Microsoft Excel 2010/2013. It is invalid in Excel 2007.


arrow blue right bubbleGet the created time and last modified time in Excel with Advanced Properties function

Actually, we can get the both created time and last modified time of current workbook in Document Properties dialog box.
Step 1: Open the Advanced Properties dialog box:

In Excel 2007, click the Office button > Prepare > Properties, and a Document Properties bar will be displayed below the toolbar, click Document Properties > Advanced Properties, see screenshots:

doc-insert-modified-time-3-3
-1
doc-insert-modified-time-4-4

 

In Excel 2010/2013, click the File > Info > Properties > Advanced Properties.

doc-insert-modified-time-4-4

Step 2: In the Advanced Properties dialog box, you will see the created time and last modified time under Statistics tab. See the following screenshot:

doc-insert-modified-time-4-4


arrow blue right bubble Insert the created time and last modified time in cells in Excel with VBA code

The following VBA macros will help you insert the created time and last modified time of current workbook information in cells directly.

Insert both created time and last modified time in Excel

Step 1: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert >> Module, and paste the following macro in the Module Window.

VBA code: Insert both created time and last modified time in Excel

Sub Workbook_Open()
Range("A1").Value = Format(ThisWorkbook.BuiltinDocumentProperties("Creation Date"), "short date")
Range("A2").Value = Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time"), "short date")
End Sub

Step 3:Press the F5 key to run this macro. And then the created date and last modified date will be inserted into cell A1 and cell A2 separately.

Note: you can modify the destination cell in the VB according to your needs.

Insert last modified time of workbook in Excel

Step 1: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert >> Module, and paste the following macro in the Module Window.

Public Function ModDate()
ModDate = Format(FileDateTime(ThisWorkbook.FullName), "m/d/yy h:n ampm")
End Function

Step 3: Then save and close this code, and go back to the worksheet, in a blank cell, enter the formula of =ModDate(), and press the Enter key. Then it inserts the last modified time in the cell.

-2

Insert created time of workbook in Excel

Step 1: Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.

Step 2: Click Insert >> Module, and paste the following macro in the Module Window.

Function CreateDate() As Date
CreateDate = ActiveWorkbook.BuiltinDocumentProperties("Creation Date")
End Function

Step 3: Save and close this code, return to the worksheet,in a blank cell, enter the formula of =CreateDate(), and press the Enter key.and the created date will be inserted into the cell as following screenshots shown:

-2

Note: If your cell is not date format, it may display a strange number. Just format this cell as Date format, it will show as a normal date.


arrow blue right bubble Insert the created time and last modified time in cells/header/footer with Kutools for Excel

May I introduce you a handy tool--Kutools for Excel which including more than 300 useful functions can enhance your working efficiency? With its Insert Workbook Information function, you can quickly insert workbook path, workbook/worksheet name, user name or created time and last modified time into cells or header or footer.

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After free installing Kutools for Excel, please do as below:

1. Click Kutools Plus > Workbook > Insert Workbook Information. See screenshot:
doc last modify name2

2. Then in the Insert Workbook Information dialog, check the information you want to insert from Information section, then go to specify the location you want to insert to, you can choose cells, footer (left footer, centre footer, right footer) or header (left header, centre header, right header). See screenshot:
doc insert created modified time 1

3. Click Ok, and the information you check has been inserted to the location you specify.

Tip. If you want to have a free trial of the Insert Workbook Information function, please go to free download Kutools for Excel first, and then go to apply the operation according above steps.

arrow blue right bubble Insert Workbook Information


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (21)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I LOOOOOOOOVE YOU!!!! TKSSSSSSS
This comment was minimized by the moderator on the site
I want to automatically create a space between each customer in excel how do i do this??
This comment was minimized by the moderator on the site
Hi Team, I need your help. I am having an excel file, there i want to find the modified date of a particular cell. Please help me with the coding here, if possible. Thanks in advance.
This comment was minimized by the moderator on the site
I learned why "Last Save Time" was not working for me. I put my function in my .XLA file, and "ThisWorkbook" was referring to the .XLA file itself. Therefore I needed to get Application.ActiveWorkbook (presumably the location of the function call), ending up with: Function DocumentProperty(PropertyName As String) ' 'You can refer to document properties either by index value or by name. The following list shows the available built-in document property names: 'Title Subject Author 'Keywords Comments Template 'Last Author Revision Number Application Name 'Last Print Date Creation Date Last Save Time 'Total Editing Time Number of Pages Number of Words 'Number of Characters Security Category 'Format Manager Company 'Number of Bytes Number of Lines Number of Paragraphs 'Number of Slides Number of Notes Number of Hidden Slides 'Number of Multimedia Clips Hyperlink Base Number of Characters (with spaces) Call Application.Volatile(True) Dim ActiveUserWorkbook On Error Resume Next Set ActiveUserWorkbook = Application.ActiveWorkbook If Err.Number 0 Then DocumentProperty = "!!! Error getting Application.ActiveWorkbook: " & Err.Description Exit Function End If DocumentProperty = ActiveUserWorkbook.BuiltinDocumentProperties(PropertyName) If Err.Number 0 Then DocumentProperty = "!!! Unknown Property Name !!!" Exit Function End If End Function
This comment was minimized by the moderator on the site
I see that "Last Save Time" is only referenced ONCE in the code. I'm using Excel 2010.When I put "Last Save Time" into a function, even with Application.Volatile(true), the value never updates. Then I noticed that the value returned by "Last Save Time" does not appear in the Excel 2010 "Properties" page NOR any of the tabs in the "Advanced Properties" dialog. Could "Last Save Time" be some relic?
This comment was minimized by the moderator on the site
Thanks for the help, but I also had a problem with the cell not updating after a save without having to first close and reopen the workbook. I added the following code to the workbook which refreshes after a save event: Private Sub Workbook_AfterSave(ByVal Success As Boolean) If Success Then ActiveSheet.Calculate End If End Sub That did the trick for me. Hope it helps.
This comment was minimized by the moderator on the site
Could this be modified to display the Created Date of other closed files? I'd like to compare the Created Date of a file on my Desktop to a file on a public web server. I could create the formula to use your functions...CreateDate() of local file to CreateDate() of web file...and alert me to a change. I appreciate your help. Bruce
This comment was minimized by the moderator on the site
very very very very very very very very helpful thanks
This comment was minimized by the moderator on the site
Hiya Love love love this but sadly the date only is appearing in USA and in Australia we have dd/mm/yy I've tired changing it to this format using the "Date" section but have not had any luck. Any ideas?
This comment was minimized by the moderator on the site
Julie - in the VBA code use "dd/mm/yy hh:n" instead. That'll put the date in the "right" order! :lol:
This comment was minimized by the moderator on the site
Hey this was awesome. Is it possible to insert the created date and last modified date of a different workbook? I'm looking to create an index file that tells me when other documents were last updated. Thanks!!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations