Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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


goodInsert Workbook Information

Kutools for Excel's Insert Workbook Information utility can quickly insert sheet name, path, user name and
so on to a cell, header or footer.
doc 1

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 Excelwhich 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 120 handy Excel functions, enhance your working efficiency and save your working time.

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

1. Click Enterprise > 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


goodExport Range to File

Kutools for Excel's Export Range to File function can export or save a range to separate file as
workbook, pdf, text, csv or text.
Click Enterprise > Import/Export > Export Range to File.
doc export cell range to file

Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Jack · 1 years ago
    I want to automatically create a space between each customer in excel how do i do this??
  • To post as a guest, your comment is unpublished.
    Sujin Raj · 1 years ago
    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.
  • To post as a guest, your comment is unpublished.
    Wayne Erfling · 2 years ago
    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
  • To post as a guest, your comment is unpublished.
    Wayne Erfling · 2 years ago
    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?
  • To post as a guest, your comment is unpublished.
    Christopher Huergo · 2 years ago
    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.