Excel: Dates Incorrect When Manipulated with MacrosLast reviewed: November 30, 1994Article ID: Q79582 |
Summary:
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. Reference(s): "Microsoft Excel User's Guide," version 3.0, page 291
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |