在带有 AppleScript 的 Excel 中,我有 10k 行和大约 200 列 XLSX。我可以通过以下方式获得已使用列的总数:
set tCols to columns of used range of activeSheet
在 200 多列中,我只需要大约 10 列,所以我将它们添加到这样的记录中:
set nRec to {"Mon","Tues","Wed"}
我可以通过以下方式循环列:
repeat with i in tCols
## further code
end repeat
但是当我尝试评估当前列的第 1 行是什么时,它会变得很重,因为它正在评估该列中的所有内容。当我使用以下测试转储列的属性时:
return i ## gets base column properties
return cells of i ## target cell scope
return columns of i ## target's column scope
return value of rows of i
每个命令都在评估该列的全部内容。AppleScript 和 Excel 中是否有办法仅获取列的字母数字值 ( A, B, C, D),以便我可以根据是否包含在我的记录中来编写条件来确定是否应该删除整个列?
我对文档的理解是,如果我有列值,我可以使用类似A1. 当我在 SO 和 MacScripter 上搜索时,我只能找到将整个专栏纳入评估的解决方案。