Home

MacOffice

This site will look better if you upgrade to a browser that supports web standards.

Entering Edit Mode with F2

In WinXL, pressing the function key F2 enters Edit Mode in the active cell. For Macs, the corresponding keyboard shortcut is CTRL-u. (On at least some Extended Keyboards, pressing the keypad's Clear/Num Lock will clear the cell and enter Edit Mode.) Since some enlightened (i.e., former) WinXL users want F2 to do the same thing on the Mac that it does in Windows, this procedure will accomplish something similar.

If you don't have a Personal Macro Workbook (PMW) started yet, choose Tools/Macro/Record new macro, choose PMW from the location dropdown and record something - selecting cells, etc. - then click the stop button.

Type Opt-F11 to enter the Visual Basic Editor. Select the Personal Macro Workbook item from the Project Browser window. Double click it to see a folder marked Microsoft Excel Objects. Open that folder and double click the ThisWorkbook icon, which opens up the ThisWorkbook code module. Paste the following into that window:

    Private Sub Workbook_Open()
        Application.OnKey "{F2}", "F2Edit"
    End Sub

Choose Insert/Module and paste this into the window that opens. Note that the control ID changed with XL2004.

    Public Sub F2Edit()
        Dim nF2 as Long
        nF2 = IIf(Application.Version < 11, 6034&, 8217&)
        CommandBars.FindControl(Id:=nF2).Execute
        Application.OnKey "{F2}", "F2Edit"
    End Sub

Save the PMW (File/Save PMW) and type Opt-F11 to return to XL. Quit XL and restart - F2 will now work to enter Edit Mode.

Valid XHTML 1.1 Valid CSS Made on a Macintosh

Quick Links

Separate the Return and Enter key behaviors