11

Can I customize Excel so that when the Excel window is not active, and I click on a cell, Excel will move to that cell?

Clicking on a cell activates the window, but Excel does not move to the cell. I must click a second time on the cell to cause Excel to move to the cell.

This seems to be a special case of a more general behavior of Excel. Excel ignores mouse clicks on inactive windows. For example, clicking a ribbon button does nothing (except the window becomes active).

Other Windows applications have the opposite behavior. They do not ignore clicks on inactive windows. The click activates the window but also does whatever a click normally would do. Clicking in an inactive Notepad window in the main text buffer activates the window but also moves the cursor to the clickpoint, clicking a menu button activates the menu, and so on.

I have looked through the choices available under File ... Options, and tried several Google searches for the answer. I did not find any relevant information.

MetaEd
  • 359
  • 2
  • 15

2 Answers2

5

You probably can't change Excel, but you can change the behavior of window to move the focus always to the window the mouse is over (control panel, 'ease of use'). That way, when you move your mouse over an (previously inactive) Excel window, it becomes active by itself, and your click will then be recognized and acted upon.

Note that such a change affects all your windows in all programs. Some people find it very useful, but some hate it.

Aganju
  • 10,161
0

Here's an AutoHotKey script that I made to solve this issue:

#Requires AutoHotkey v2.0
#SingleInstance

excelExt := ".xls" ; a string that appears in the title of all applications you want this to apply to

WaitExcel(){ ; start function if WinWaitActive(excelExt){ ; wait for excel to be selected Click 2 ; click twice } if WinWaitNotActive(excelExt){ ; wait for excel to be not selected (to reapply wait) WaitExcel ; call the function again to refresh the listener }
} WaitExcel ; start the listening process

Here's a link to download AutoHotKey: https://autohotkey.com/

Thanks to @Engineer Toast for the suggestion.