Microsoft KB Archive/79582

{| = Excel: Dates Incorrect When Manipulated with XLM Macros =
 * width="100%"|

Last reviewed: March 25, 1998

Article ID: Q79582

SUMMARY
XLM macros that operate on worksheet dates give incorrect results or change worksheet dates by four years and one day if the worksheet and macro sheet are using different date systems.

To make sure the dates display correctly upon running the macro, make sure that the worksheet and the macro sheet have the same date system selected by choosing the Calculation command from the Options menu.

This information applies to Microsoft Excel for the Macintosh versions 2.2 and 3.0; Excel for Windows versions 2.1 and 3.0; and Excel for OS/2 versions 2.2, 2.21, and 3.0.

MORE INFORMATION
The default date system for the Macintosh is 1904. The 1900 date system (1904 not selected) is available for compatibility with Windows and OS/2.

The following is an example of a macro formula that may cause dates to appear incorrectly:

=FORMULA(NOW,!A1) Normally, this would place today's date in cell A1 on the active worksheet. If the macro sheet is using a different date system, it will return a date that is off by four years and one day. The same problem will occur if dates are copied and pasted from worksheets that are using different date systems.

For more information about problems that occur when using different date systems, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: Q180162 TITLE    : XL: The 1900 Date System vs. the 1904 Date System