Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在excel中使用AppleScript将单元格值增加1?_Excel_Applescript - Fatal编程技术网

如何在excel中使用AppleScript将单元格值增加1?

如何在excel中使用AppleScript将单元格值增加1?,excel,applescript,Excel,Applescript,这应该很简单,但我可能没有正确的方法。我只想将单元格“C7”的值从4增加到5。这就是我想象的工作方式。非常感谢您的建议 tell application "Microsoft Excel" get value of cell "C7" set value of cell "C7" to current value +1 end tell 在VBA和Applescript中,Excel需要知道要处理的工作簿和工作表。假设要更改单元格的工作簿和工作表是激活的,则: tell app

这应该很简单,但我可能没有正确的方法。我只想将单元格“C7”的值从4增加到5。这就是我想象的工作方式。非常感谢您的建议

tell application "Microsoft Excel"
    get value of cell "C7"
    set value of cell "C7" to current value +1
end tell

在VBA和Applescript中,Excel需要知道要处理的工作簿和工作表。假设要更改单元格的工作簿和工作表是激活的,则:

tell application "Microsoft Excel"
tell active workbook to tell active sheet to set value of cell "C7" to (value of cell "C7") + 1
end tell