Microsoft KB Archive/33701

Adding Current Date to Custom Dialog Box in Excel PSS ID Number: Q33701 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.x 3.00 | 2.20 2.21 3.00 | 2.20 3.00

WINDOWS | OS/2 | MACINTOSH

Summary:

To add the current date to a custom dialog box, you must create a fixed text entry in the dialog_ref area as follows:

  Enter a 5 in the item column of the dialog_ref area.   Enter the appropriate values into the x, y, height, and width values in order to position the date in the dialog box.   Enter the following formula into the corresponding text column: =TEXT(NOW,“mmmm d, yyyy”) 

This procedure will add the current date to your dialog box in the form of “February 10, 1990”. You can modify this format by editing the format_text argument of the TEXT function.

More Information:

Assuming the text column of this type 5 dialog box line is cell G5, the following macro line will create the above formula automatically:

=FORMULA(“=TEXT(NOW,”“MMMM D, YYYY”“)”,G5)

Note: This information also applies to Excel for the Macintosh, versions 2.2 and 3.0.

Additional reference words: 2.1 2.10 2.20 2.2 3.0 3.00

Copyright Microsoft Corporation 1993.