Excel Macro to Convert yymmdd Date Format to a Serial NumberLast reviewed: November 2, 1994Article ID: Q44736 |
The information in this article applies to:
SUMMARYDated records from a mainframe may import as yymmdd (for example, January 1, 1991 is represented as 910101) in Excel. The format is not recognized by Excel and must be converted to a serial number.
MORE INFORMATIONThe following short macro converts a mainframe date, with no separators, to Excel format:
A1: <<Name of macro>> A2: =DATE(LEFT(ACTIVE.CELL(),2),MID(ACTIVE.CELL(),3,2), RIGHT(ACTIVE.CELL(),2)) A3: =FORMULA(A2) A4: =FORMAT.NUMBER("mm-dd-yy") A5: =SELECT("R[1]C") A6: =IF(ACTIVE.CELL()<>"",GOTO(A2),RETURN())The above macro assumes the following:
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |