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
Office Tab Enable Tabbed Editing and Browsing in Office, and Make Your Work Much Easier...
Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%
  • Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
  • More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
  • Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
  • Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
  • Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
  • Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
  • More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.

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

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

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!
officetab bottom
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 · 2 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.
  • To post as a guest, your comment is unpublished.
    Bruce · 3 years ago
    Could this be modified to display the Created Date of [i]other[/i] 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
  • To post as a guest, your comment is unpublished.
    Mokhtar · 4 years ago
    very very very very very very very very helpful
    thanks
  • To post as a guest, your comment is unpublished.
    JulieHughes · 4 years ago
    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?
    • To post as a guest, your comment is unpublished.
      MurrayFree · 4 years ago
      Julie - in the VBA code use "dd/mm/yy hh:n" instead. That'll put the date in the "right" order!
      :lol:
  • To post as a guest, your comment is unpublished.
    DavidC · 5 years ago
    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!!
  • To post as a guest, your comment is unpublished.
    Ashraf · 5 years ago
    Please help!!!

    need to return last modified date and time of a closed file, and return this info in a cell in the open file
  • To post as a guest, your comment is unpublished.
    Swaran · 5 years ago
    [quote name="Larry S. Peteet"]Hello:
    I did this a different way but also by coding. Since I added code it makes me save the workbook with Macros and consequently as a *.XLSM. That is fine but a lot of places won't allow Macros's like this.
    Is there a way to get this (or save the workbook with the change) to a normal .XLS?
    I also assume it will ask someone to "Enable Macros" if they have that setting turned on (I am a consultant and most places I work it makes me turn on Macros when applicable after opening a workbook).
    FYI: Here is how I did it in a Macro (not better; just different).
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
    Cancel As Boolean)

    Cancel = False
    With ActiveSheet.PageSetup
    ' .LeftHeader = ""
    ' .CenterHeader = ""
    ' .RightHeader = "Last Update " & Format(Now(), "mm/dd/yyyy")
    .RightHeader = ""
    .RightFooter = "Last Updated " & Format(Now(), "mm/dd/yyyy")
    End With

    End Sub[/quote]

    Hi

    I successfully inserted the Last modified Date and time, but it doesnt update when you save and re-open the workbook.

    Please help here......i dont know about coding so I basically copy whatever info is given on such forums

    Thanks
    Swaran
    • To post as a guest, your comment is unpublished.
      BillG · 5 years ago
      Yes I have same issue - it worked perfectly yesterday but then today it would not change when saved.
  • To post as a guest, your comment is unpublished.
    UMAIR · 5 years ago
    thanks for this info
  • To post as a guest, your comment is unpublished.
    UMAIR · 5 years ago
    This information is very helpful for me.
    thanks concern
  • To post as a guest, your comment is unpublished.
    Larry S. Peteet · 5 years ago
    Hello:
    I did this a different way but also by coding. Since I added code it makes me save the workbook with Macros and consequently as a *.XLSM. That is fine but a lot of places won't allow Macros's like this.
    Is there a way to get this (or save the workbook with the change) to a normal .XLS?
    I also assume it will ask someone to "Enable Macros" if they have that setting turned on (I am a consultant and most places I work it makes me turn on Macros when applicable after opening a workbook).
    FYI: Here is how I did it in a Macro (not better; just different).
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
    Cancel As Boolean)

    Cancel = False
    With ActiveSheet.PageSetup
    ' .LeftHeader = ""
    ' .CenterHeader = ""
    ' .RightHeader = "Last Update " & Format(Now(), "mm/dd/yyyy")
    .RightHeader = ""
    .RightFooter = "Last Updated " & Format(Now(), "mm/dd/yyyy")
    End With

    End Sub
  • To post as a guest, your comment is unpublished.
    Khalid · 5 years ago
    Thank you very much for help, these what we need.
    the codes work properly but without update, means do not update the date of modification once i save.
    do you have any solution for this?

    i tried many times, save, close then re-open, with no update for the date.
    • To post as a guest, your comment is unpublished.
      Alex · 3 years ago
      Hi Khalid,

      I had the same issue and I added the line "Application.Volatile" to the code and when I press F9 it will update the information.
      I saw it in the video "Learn Excel - "Function for Last Saved Time": Podcast #1725 " of Bill Jelen.
      @Bill: Thank so much for the video!

      https://www.youtube.com/watch?v=KnSA6xdmc2Q

      Regards,
      Alex
  • To post as a guest, your comment is unpublished.
    Brian · 5 years ago
    This was perfect. Exactly what I was looking for. Thanks so much!!
  • To post as a guest, your comment is unpublished.
    Syed Nehal · 5 years ago
    Helpful information.... :-)