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
METHOD 1. Display the current date and time in the Title Bar when opening a workbook using VBA
VBA
Private Sub Workbook_Open()
'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: For this VBA code to be run when the workbook is opened, this VBA code needs to be inserted into the "ThisWorkbook" Microsoft Excel Object.
VBA Code: For this VBA code to be run when the workbook is opened, 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 opening a workbook
EXPLANATION
EXPLANATION
This tutorial explains and provides step by step instructions on how to display the current date and time in the Title Bar when opening a workbook. 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_Open, which means that the vba code will be run when the Excel document is opened.
This tutorial explains and provides step by step instructions on how to display the current date and time in the Title Bar when opening a workbook. 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_Open, which means that the vba code will be run when the Excel document is opened.
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 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 |