【问题标题】:Iterating Applescript over all sheets in an Excel workbook在 Excel 工作簿中的所有工作表上迭代 Applescript
【发布时间】:2012-12-02 11:57:55
【问题描述】:

我进行了一些搜索,但似乎找不到如何让我的 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

【问题讨论】:

    标签: excel applescript automator


    【解决方案1】:

    试试:

    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
    

    【讨论】:

    • 如果您想排除所有内容的前 5 张,它将如何工作?
    猜你喜欢
    • 1970-01-01
    • 2022-11-24
    • 1970-01-01
    • 2014-01-28
    • 1970-01-01
    • 2019-10-25
    • 1970-01-01
    • 2015-08-18
    • 1970-01-01
    相关资源
    最近更新 更多