banner_ad

Edit in Formula bar instead of cell

Others 626 views 1 replies

 

While many, if not most, users have the "Edit directly in cell" option turned on, and press F2 to edit the contents of a cell, some users still prefer to edit within the formula bar. If "Edit  directly in cell" (Tools menu, Options, Edit tab, "Edit directly in cell") is UNchecked, pressing F2 will set the input focus to the formula bar, as expected. However, if "Edit directly in cell" is checked, and you need or want to edit within the formula bar, there is no built-in shortcut key to take you to the Formula bar -- you must use the mouse.  The following macro will set the focus to the formula bar. You can then assign a keyboard shortcut to run this macro, thus giving you a keyboard shortcut to the formula bar.

 

   


Public Declare Function SetFocus Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, ByVal lpsz2 As String) As Long

Sub SetFocusFormulaBar()
    SetFocus FindWindowEx(FindWindow("XLMAIN", Application.Caption), _
        0&, "EXCEL<", vbNullString)
End Sub

Replies (1)

I recommend adding this procedure to your Personal.xls workbook so that it will always be available...

 

:) cheers :)


CCI Pro

Leave a Reply

Your are not logged in . Please login to post replies

Click here to Login / Register  

Company
21 May 2026
Associate

PWC

Kolkata

CA

View Details
Company
07 June 2026
Tax Associate

Rajkumar Jain & Co.

Ahmedabad

Graduate (Any)

View Details
Company
26 May 2026
Senior Accountant cum purchase Manager

Vardhaman Group of India

Pimpri Chinchwad

CA Inter

View Details
Company
Featured 27 May 2026
Lead Conversion Executive / Sales Closing Executive

SMJ global advisors pvt ltd

New Delhi

B.Com

View Details
Company
09 June 2026
Accounts Associate

S Madan and CO

New Delhi

Graduate (Any)

View Details
Company
ARTICLESHIP 31 May 2026
Article Assistant

KPRS And Associates

New Delhi

CA Inter

View Details
Company
01 June 2026
Audit, Taxation & Compliance Executive

R P S K & Associates

Nashik

CA Inter

View Details
Company
16 May 2026
Account & Audit Asst

RAHUL KHANDEBHARAD & ASSOCIATES

Nashik

B.Com

View Details