• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

danblee.com

Tutorials & Knowledge Base Articles for System Administrators who wear many, many hats.

  • Home
  • About
  • Ask Me
  • DBLHost.com

Display Modified Date of Excel File

December 19, 2012 by Dan B. Lee 11 Comments

In my last post about how to append or prepend text to data in a cell, Larry asked how one might be able to display the modified date of an excel file. This tutorial will explain the most efficient way to display the modified date of the file you are working on in a cell.

Get Ready For Macros

Getting right to it, the modified date of an excel file exists, but it isn’t accessible via any of the functions that Excel has created for us. Instead, we’ll create our own function in the Visual Basic side of Excel so we can gather the information we need and then put it in a cell just as if it were a typical function.

Follow these steps:

  1. Open a file that is macro enabled. The use of macros is disabled by default. If you have a file open already, you’ll need to do a file > save as and choose to save it as a macro enabled file.
  2. Hit CTRL + F11 ALT+F11 (Edit thanks to FLoffice in comments). This will take you to the Visual Basic side of the excel file. I promise, this place isn’t as scare as it looks.
  3. At the top, choose Insert > Module. A new text window called Module1 will pop up.
  4. Enter the following code in the module and save the file.Public Function GetModifiedDate() As Date
    Application.Volatile
    GetModifiedDate = _
    ThisWorkbook.BuiltinDocumentProperties("Last Save Time")
    End Function
  5. You just created a workable function called GetModifiedDate(). You can use this just like any other function. In fact, excel will even auto-complete as if you were typing in any of the other functions. Give it a try, head back to the excel file, click on a cell, and type in “=GetModifiedDate()” and hit enter.
  6. You’ll see some weird numbers. This was discussed in my append\prepend post, but basically you’ll just need to change the formatting to date and you’ll be set.

Let me know how it goes. Cheers!

 

Filed Under: Microsoft Excel Tagged With: excel functions, macros, public functions

Primary Sidebar

Categories

  • Active Directory
    • Group Policy
  • Adobe Photoshop
  • Browsers
    • Chrome
  • Cloud Based Technology
    • Citrix XenApp
  • ConnectWise
    • LabTech
  • Dell
  • Internet Service Providers (ISPs)
  • iPhone
  • Linux
    • CentOS
    • OpenVPN
    • SaltStack
    • Ubuntu
  • Microsoft Office
    • Lync
    • Microsoft Excel
    • Microsoft Outlook
    • Microsoft Word
  • Microsoft Windows
    • Active Directory
    • PowerShell
    • Windows 7
    • Windows 8 Preview & Release
  • Networks
  • News
  • Off Topic
  • Office 365
  • Peripherals
    • Monitors
  • Printers
    • Local Printers
    • Network Printers
  • Programming
    • Python
  • Riverbed
  • Security
  • Sharepoint
  • Social Media
  • Splunk
  • Storage
  • Switching & Routing
    • Cisco
    • Fortinet
  • Technology Culture
    • Opinion
  • Uncategorized
  • Virtualization
    • VEEAM
    • VMware
  • WAMP
  • Web Hosting
    • WHMCS
  • Website Design
  • Windows Server
    • Exchange 2003
    • Exchange 2010
    • Exchange 2013
    • Microsoft SQL
    • Windows Server 2003
    • Windows Server 2008 R2
    • Windows Server 2012
  • WordPress

Footer

Recent Activity

  • idrac default login - Credit One on Dell iDRAC Default Username and Password
  • Windows Server hanya menampilkan Command Prompt setelah restart - Hanya Trial on Windows Server 2012 Just Showing a Command Prompt
  • pings on Xerox Phaser 3635MFP Default Admin Username and Password
  • Xerox Phaser 3635MFP Default Admin Username and Password — danblee.com on About Dan B. Lee
  • Estudio Login | LOGINEGG on Toshiba E-Studio Default Administrator Username and Password

Dan Lee

Dan B. Lee works at SyApps, LLC., a Managed Hosting Solutions Firm, as a Senior Network Engineer. Dan has a decade of IT experience and specializes in a number of different disciplines including Virtualization, Web Site Hosting and Design, Network Security, Data Center Architecture, Local and Remote Server Hosting, and Backup & DRS Solutions. Read More…

Links

  • Home
  • About Dan B. Lee
  • Ask Me
  • Privacy Policy

Copyright © 2021 · Genesis Child Theme on Genesis Framework · WordPress · Log in