excel - 在 Excel 工作簿中的所有工作表上迭代 Applescript

标签 excel applescript automator

我已经进行了一些搜索,但似乎无法找到如何让我的 Applescript 迭代 Excel 工作簿中的每个工作表。目前,我只是告诉脚本无限重复并手动单击工作表,这并不理想!

这就是我想要对工作簿中的每张工作表执行的操作,关于如何实现此目的有什么想法吗?

tell application "Microsoft Excel"
        set rangeVoltage to value of range "A11:A110"
        set value of cell "D11:D110" to rangeVoltage        
        set value of cell "E11" to "=B11*1000"
        fill down range "E11:E110"
        set value of cell "D10" to "Voc (V)"
        set value of cell "E10" to "Isc (mA)"
end tell

最佳答案

尝试:

tell application "Microsoft Excel"
    set mySheets to every sheet of active workbook
    repeat with aSheet in mySheets
        tell aSheet
            set rangeVoltage to value of range "A11:A110"
            set value of cell "D11:D110" to rangeVoltage
            set value of cell "E11" to "=B11*1000"
            fill down range "E11:E110"
            set value of cell "D10" to "Voc (V)"
            set value of cell "E10" to "Isc (mA)"
        end tell
    end repeat
end tell

关于excel - 在 Excel 工作簿中的所有工作表上迭代 Applescript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13879425/

相关文章:

macos - 在applescript中,如何访问菜单项的键盘快捷键?

macos - 创建类似 Dropbox 的 DMG 包

objective-c - 在自定义 Automator 操作中保存用户弹出选择

Objective-C:自动化

excel - 如何从Excel单元格中获取所有大写字符?

excel - 使用变量作为应用程序名称

macos - Applescript 错误 -10810

bash - 有没有办法通过 Shell 脚本、AppleScript 或 Automator 工作流程触发热键/键盘快捷键?

python - 有没有办法使用 python 修改现有的 xlsm 文件?

c# - Excel.Range 到 C# 中的字符串转换