Also, I didn't realize my name would be published. Any chance of changing it to Nancy E.?
Kutools for Excel is a powerful add-in that frees you from performing time-consuming operations in Excel, such as combine sheets quickly, merge cells without losing data, paste to only visible cells, count cells by color and so on. 300+ powerful features / functions for Excel 2019, 2016, 2013, 2010, 2007 or Office 365!
It enables tabbed browsing, editing, and managing of Microsoft Office applications. You can open multiple documents / files in a single tabbed window, such as using the browser IE 8/9/10, Firefox, and Google Chrome. It's compatible with Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365. Demo
Kutools for Outlook is a powerful add-in that frees you from time-consuming operations which majority of Outlook users has to perform daily! It can save your time from using Microsoft Outlook 2019, 2016, 2013, 2010 or Office 365!
Kutools for Word is a powerful add-in that frees you from time-consuming operations which majority of Word users have to perform daily! It can save your time from using Microsoft Word / Office 2019, 2016, 2013, 2010, 2007, 2003 or Office 365!
Restores the old look and menus of Office 2003 to Microsoft Office 2019, 2016, 2013, 2010, 2007 or Office 365. Don’t lose time in finding commands on the new Ribbon. Easy to deploy to all computers in enterprises and organizations.
In Excel, we can quickly and easily insert the workbook information, such as file name, file full path, current date and so on into the header or footer. But have you ever tried to insert last modified date and time of the worksheet into them? Excel doesn’t provide this feature for us to insert the last modified date in header or footer, and here, I will introduce you a handy way to solve it.
The following simple VBA code can help you to insert last saved date and time of the worksheet in to the header or footer, please do as this:
1. Activate your worksheet that you want to insert the last modified date into the header or footer.
2. Then hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
3. In the left VBAProject pane, double click ThisWorkbook to open the Module, then copy and paste the following code.
VBA code: Insert last modified date in header or footer
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) ActiveSheet.PageSetup.CenterHeader = "Last saved: " & Format(Date, "mm-dd-yy") & " " & Time End Sub
4. Then save and close this code, and go to click View > Page Layout to view the result. And you can see the last modified date and time has been inserted into the center header. See screenshots:
1. The last modified date and time is updated automatically, when you modify and save the Excel file.
2. If you need to insert this last saved date and time into the left header/footer, right header/footer or center footer, you just need to change the CenterHeader in the above code to your request.
With Kutools for Excel, you can uset the Insert Workbook Information tool to quickly insert the workbook information to header, footer, or a cell.
|Kutools for Excel, with more than 300 handy functions, makes your jobs more easier.|
After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)
Click Kutools Plus > Workbook ＞Insert Workbook Information, and in the popping dialog, check the information you want to insert , and go to Insert at section, check Range, Header or Footer option, and specify to insert at left header/footer, center header/footer or right header/footer to meet your need.