(Autohotkey) 需要帮助选择不同的 Excel 带有“+1”的单元格..或者我不知道如何调用它
(Autohotkey) need help for selecting different Excel cell with "+1" thingy.. or i don't know how to call it
我需要 Excel 使用 autohotkey 进行自动化的帮助..
所以我想 select 第一个输入中的“A1”单元格,然后对于第二个、第三个和下一个输入,我想 select “A”单元格 +1,
所以第二个输入中的“A”单元格 selected 将是 A2
在第 3 个输入中输入的“A”单元格 select 将是 A3,等等...
所以大概是这样的..
INPUT1:
X=1
oExcel := ComObjActive("Excel.Application")
oExcel.Sheets("SHEET").Activate
oExcel.Range("A1").Select
goto, INPUTX:
INPUTX:
X = +1
oExcel := ComObjActive("Excel.Application")
oExcel.Sheets("SHEET").Activate
oExcel.Range("A(X)").Select
但我不知道如何在 AHK 代码中正确编写它...。有人可以帮我解决这个问题吗?非常感谢...
别担心,你快到了。我想这就是你想要的。您可能想要循环,并且还需要将数字连接到单元格名称中
DoMyStuff:
/* You only need to get the Excel COM object once.
* So we do this here, outside of the loop. */
oExcel := ComObjActive("Excel.Application")
; activate the sheet once.
oExcel.Sheets("SHEET").Activate
Loop, 100 ; this repeats the following code from 1 to 100.
{
/* A_Index in a "Loop" block becomes 1..2..3..
* to 100 (each loop pass) or whatever is set above.
* With AHK v1.1, you can concat like so:
* "something" 42 "anotherthing"
* gives
* "something42anotherthing"
*/
oExcel.Range("A" A_Index).Select
}
return
我需要 Excel 使用 autohotkey 进行自动化的帮助..
所以我想 select 第一个输入中的“A1”单元格,然后对于第二个、第三个和下一个输入,我想 select “A”单元格 +1, 所以第二个输入中的“A”单元格 selected 将是 A2 在第 3 个输入中输入的“A”单元格 select 将是 A3,等等...
所以大概是这样的..
INPUT1:
X=1
oExcel := ComObjActive("Excel.Application")
oExcel.Sheets("SHEET").Activate
oExcel.Range("A1").Select
goto, INPUTX:
INPUTX:
X = +1
oExcel := ComObjActive("Excel.Application")
oExcel.Sheets("SHEET").Activate
oExcel.Range("A(X)").Select
但我不知道如何在 AHK 代码中正确编写它...。有人可以帮我解决这个问题吗?非常感谢...
别担心,你快到了。我想这就是你想要的。您可能想要循环,并且还需要将数字连接到单元格名称中
DoMyStuff:
/* You only need to get the Excel COM object once.
* So we do this here, outside of the loop. */
oExcel := ComObjActive("Excel.Application")
; activate the sheet once.
oExcel.Sheets("SHEET").Activate
Loop, 100 ; this repeats the following code from 1 to 100.
{
/* A_Index in a "Loop" block becomes 1..2..3..
* to 100 (each loop pass) or whatever is set above.
* With AHK v1.1, you can concat like so:
* "something" 42 "anotherthing"
* gives
* "something42anotherthing"
*/
oExcel.Range("A" A_Index).Select
}
return