Display the current date and time in the Title Bar when a workbook was last saved
How to display the current date and time in the Title Bar when a workbook was last saved using VBA
METHOD 1. Display the current date and time in the Title Bar when a workbook was last saved using VBA
VBA
Private Sub Workbook_AfterSave(ByVal Success As Boolean)
'display the current date and time in the second caption of the Title Bar
Application.Caption = Now()
Application.Caption = Now()
'clear the first caption of the Title Bar
ActiveWindow.Caption = Empty
ActiveWindow.Caption = Empty
End Sub
NOTES
VBA Code: This VBA code needs to be inserted into the "ThisWorkbook" Microsoft Excel Object.
VBA Code: This VBA code needs to be inserted into the "ThisWorkbook" Microsoft Excel Object.
Explanation about how to display the current date and time in the Title Bar when a workbook was last saved
EXPLANATION
EXPLANATION
This tutorial explains and provides step by step instructions on how todisplay the current date and time in the Title Bar when a workbook was last saved. Using VBA this can be achieved by removing the first component of the Title Bar's caption and assigning the current time and date, through the Now() function, to the second component of the Title Bar's caption. In addition, you will need to set the Macro procedure title to Workbook_AfterSave(ByVal Success As Boolean), which means that the vba code will be run after a workbook is saved.
This tutorial explains and provides step by step instructions on how todisplay the current date and time in the Title Bar when a workbook was last saved. Using VBA this can be achieved by removing the first component of the Title Bar's caption and assigning the current time and date, through the Now() function, to the second component of the Title Bar's caption. In addition, you will need to set the Macro procedure title to Workbook_AfterSave(ByVal Success As Boolean), which means that the vba code will be run after a workbook is saved.
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Display the current date and time in the Title Bar | How to display the current date and time in the Title Bar using VBA | |
Display the current date and time in the Title Bar when opening a workbook | How to display the current date and time in the Title Bar when opening a workbook using VBA |