0

I'm trying to create a couple hotstrings using arrow keys to select cells for the formula that is created.

:*:=concacane::
send =CONCATENATE({right},{right 2},{right 3})
return

The above is the code that I was hoping would work to call the 'CONCATENATE' function and select the three cells to the right of the cell I was typing in. Unfortunately Excel seems to escape the cell I was working in, and I end up with commas and parenthesis spread across a few cells to the right instead of the working formula I was looking for.

I tried using 'sendraw' and adding everything after '=CONCATENATE(' on a second 'send' line hoping that the '=' was some kind of modifier that was messing me up, but that didn't seem to help. I also tried using a key combination instead of a hotstring but I couldn't get that script to do anything at all and a key combination would be less than ideal anyway...

Does anybody have any idea how I can get this to work? Thanks in advance!

4

2 に答える 2

0

これはCOMで行うことができます

:*:cc\::
send, {Escape}
XlApp := ComObjActive("Excel.Application")
a := XlApp.ActiveCell.Offset(0,1).Address
b := XlApp.ActiveCell.Offset(0,2).Address
c := XlApp.ActiveCell.Offset(0,3).Address
XlApp.ActiveCell.Offset(0,0).value := "=CONCATENATE(" a "," b "," c ")"
Return
于 2016-07-25T06:26:34.913 に答える
0

{right} コマンドの前後にスペースを追加すると、これが機能すると思います。

:*:cc\:: ; cc\ is shorter for me than =concacane
Send, =CONCATENATE( {right 1} , {right 2} , {right 3} ) {Enter}
Return

これをExcelでテストしたところ、機能しました。

于 2013-01-17T21:16:12.877 に答える