You want to display the name of the author or who has saved the Excel file the last time? Or you want to insert the date last saved, the date created or the file size into an Excel cell? Unfortunately, there is no way without some disadvantages. Let’s take a look at three different methods.
Method 1: Do it manually
I know, it sounds stupid, but often doing it manually is the fastest way and doesn’t come with some of the disadvantages of the next two methods. Just type the current date or your name into the dedicated Excel cell.
In case you want to show the current time you could also use a keyboard shortcut. Press Ctrl + Semi-colon (;) on the keyboard and Excel will write the current date into the currently selected Excel cell.
Method 2: Use a VBA macro
Because there is no automatic built-in way to return some of the meta data of your file in an Excel cell, you need to use a VBA macro. Therefore, you have to insert a new VBA module to your workbook. If you need assistance with the, please refer to this article. Once you have a new Excel module, simply copy and paste one of the following code snippets into this module. As you have done all the preparations now you can use the corresponding Excel formula in your worksheet.
Example: Insert the date last saved into an Excel cell.
- Press Alt + F11 on the keyboard. The VBA editor should open.
- Add a new Excel module in your current Excel workbook. In order to achieve this, right-click on “Modules” (or on any other item of your current workbook) within the VBAProject explorer in the top left corner. Next, click on “Insert” and then on “Module”.
- Copy and paste one of the following codes into the new Excel module. In case of the date last saved, use this code:
Function ProfessorExcelLastSaveDate()
ProfessorExcelLastSaveDate = FileDateTime(ActiveWorkbook.FullName)
End Function
Go back to your Excel workbook and type this formula into your Excel cell:
=ProfessorExcelLastSaveDate()
Please note: In order to show correct values for some of the formulas, you have to save your workbook first.
Insert Date Last Saved
For inserting the date on which the workbook was saved the last time use the following VBA code.
Function ProfessorExcelLastSaveDate()
ProfessorExcelLastSaveDate = FileDateTime(ActiveWorkbook.FullName)
End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSaveDate()
Insert Date Created
VBA macro code for inserting the date the workbook was created.
Function ProfessorExcelDateCreated()
ProfessorExcelDateCreated = ThisWorkbook.BuiltinDocumentProperties("Creation date")
End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSaveDate()
Insert Workbook Last Saved By
VBA macro code for inserting the name of the person who saved the workbook the last time.
Function ProfessorExcelLastSavedBy()
ProfessorExcelLastSavedBy = ThisWorkbook.BuiltinDocumentProperties("Last Author")
End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelLastSavedBy()
Insert Author Name
VBA macro code for inserting the author name of your Excel workbook.
Function ProfessorExcelAuthor()
ProfessorExcelAuthor = ThisWorkbook.BuiltinDocumentProperties("Author")
End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelAuthor()
Insert File Size
VBA macro code for inserting the file size of your Excel workbook.
Function ProfessorExcelFileSize()
ProfessorExcelFileSize = FileLen(ThisWorkbook.FullName)
End Function
In your Excel worksheet, insert this following formula.
=ProfessorExcelFileSize()
Method 3: Use the Excel add-in "Professor Excel Tools"
Are you looking for a more comfortable way? A method, in which you don't have to use a VBA macro? The Excel add-in "Professor Excel Tools" offers exactly that.
What do you have to do? Just download the add-in (click here). Don't worry, the integrated formulas also work after the trial period is over. Then type one of the following formulas in your Excel cell.
Insert Date Last Saved
The formula looks like this: =PROFEXDateLastSaved(A1) . Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
Insert Date Created
The formula looks like this: =PROFEXDateCreated(A1) . Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
Insert Workbook Last Saved By
The formula looks like this: =PROFEXLastSavedBy(A1) . Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
Insert Author Name
The formula looks like this: =PROFEXAuthor(A1) . Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
Insert File Size
The formula looks like this: =PROFEXFileSize(A1) . Instead of referring to cell A1 in this formula, you can also link to another worksheet or another workbook.
This function is included in our Excel Add-In 'Professor Excel Tools'
(No sign-up, download starts directly)
More than 35,000 users can't be wrong.
Download
Please feel free to download all examples above in one Excel workbook. Just click on this link and the download starts right away.
Hello,
What if I needed last save on multiple worksheets within a workbook?
I have a workbook that houses several worksheets and several people can revise data. How can I determine the last time a specific sheet was updated?
Function ProfessorExcelLastSavedBy()
ProfessorExcelLastSavedBy = ThisWorkbook.BuiltinDocumentProperties(“Last Author”)
End Function
on the ‘ThisWorkbook’ part,
How can I change this portion to a file path so that the vba code captures the Last Author of a file saved on a different location and not the file that is currently open?