2012-12-14 63 views
2

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

这就是我想为工作簿中的每张纸做的事情,关于如何实现这一点的任何想法?

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 

回答

2

尝试:

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 
+0

如果你想exlude让我们说这一切的第5张将如何运作? –

相关问题