Microsoft KB Archive/88677

{|
 * width="100%"|

Excel: END Key Functionality Changed in Version 4.0

 * }

-

The information in this article applies to:


 * Microsoft Excel for Windows, versions 4.0, 4.0a, 5.0
 * Microsoft Excel for the Macintosh, versions 4.0, 5.0

-

SUMMARY
In Microsoft Excel, the functionality of the END key was changed in version 4.0 and later. In version 3.0, pressing the END key moved the active cell to the last cell in the current row. In version 4.0 and later, pressing the END key toggles END mode on and off. If you press END followed by the ENTER key (RETURN on the Macintosh), Microsoft Excel moves the active cell to the last cell in the current row.

MORE INFORMATION
The functionality of the END key was changed to incorporate END mode, which provides a number of ways to move and select cells in a worksheet. For more information on moving and selecting with the END key, see pages 80-82 in &quot;User's Guide&quot; version 5.0 or pages 548-551 in &quot;User's Guide 1&quot; version 4.0.

Macros to Return Microsoft Excel 3.0 Functionality to the END Key
The following set of macros returns Microsoft Excel 3.0 functionality to the END key in Microsoft Excel 4.0. For more information about writing command macros, see pages 235 to 237 in &quot;Microsoft Excel User's Guide 2.&quot;

After entering and naming these macros, save and close your macro sheet and then reopen it. The Auto_Open macro runs automatically when you open your macro sheet.

 A1: Auto_Open A2: =ON.KEY(&quot;{END}&quot;,&quot;Excel_3.0_End_Key&quot;) A3: =ON.KEY(&quot;+{END}&quot;,&quot;Excel_3.0_Shift_End_Key&quot;) A4: =RETURN A5: A6: Excel_3.0_End_Key A7: LastCol=GET.DOCUMENT(12) A8: =SELECT(&quot;RC&quot;&IF(LastCol>0,LastCol,&quot;&quot;)) A9: =RETURN A10: A11: Excel_3.0_Shift_End_Key A12: LastCol=GET.DOCUMENT(12) A13: =SELECT(&quot;RC:RC&quot;&IF(LastCol>0,LastCol,&quot;&quot;)) A14: =RETURN

The ON.KEY functions tell Microsoft Excel to run the assigned macros when the END key is pressed. The +{END} version handles the case where SHIFT+END is pressed to select the cells between the current cell and the last cell in the current row.