I don't want Excel to change the default behavior. The way it works now is the right way for most people. I just want to be able to enter a mode where I get to freely edit the formula as if it were in a text editor, then exit that mode when I'm satisfied. Whether that is some checkbox option buried in the settings ("Options > Formulas > Working with formulas"), or an F-key, I don't care.
Normally the first one commits the formula, the second one inserts a newline. I want to reverse that and make a naked [Enter] insert the newline, and the [Alt]+[Enter] commit the formula.
Committing a formula needs to be a simple shortcut because it has to be used by the least technical users. You don't want to create a "how to exit VIM" mess in a retail product.
#if IsExcelFormulaBox() ; Whenever the formula edit box has focus
Tab::Send {Space}{Space}{Space}{Space} ; insert four spaces when I hit [Tab]
$!Enter::Send {Enter} ; commit the formula with [Alt]+[Enter]
$Enter::Send !{Enter} ; insert a newline with bare [Enter]
#if
does what I want, with the helper function: IsExcelFormulaBox() {
ControlGetFocus, F, A
return (F="EXCEL<1")
}Beside clicking on a cell already has a meaning, it inserts the address of the cell you are clicking on in the formula.