Article ID: 213742 - View products that this article applies to.
This article was previously published under Q213742
For a Microsoft Excel 98 Macintosh Edition version of this article, see 184501
For a Microsoft Excel 97 version of this article, see 161607
In Microsoft Excel, when you use the date code, &[Date], to insert the date in the header or footer of a document, the date appears in the default "MM/DD/YY" format. The time code, &[Time], appears in the default "H:MM AM/PM" format. These date and time formats are based on the Date and Time tabs in the Regional Settings Properties dialog box.
Note The names of user interfaces in some Windows versions maybe different from those names in the following steps.
To open the Regional Settings Properties dialog box, follow these steps:
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Visual Basic for Applications Macro ExampleTo create a macro that places the current date in the header in the "MMM DD, YYYY" format, follow these steps:
Contact us for more help
Connect with Answer Desk for expert help.