我想使用AppleScript查找我放在数据集旁边的TAG单元格,以便我可以在单独的结果表中链接到这些值。
目前我得到的只是错误告诉我这个,那个和另一个不理解发现。这是脚本:
tell application "Microsoft Excel"
tell active workbook
activate object worksheet "1001"
tell sheet "1001"
set searchRange to used range
tell searchRange
(find searchRange what "TAG")
end tell
end tell
end tell
end tell
我是一个完全的初学者,这完全被难倒了
答案 0 :(得分:0)
以下内容适用于我:(此代码介于tell sheet "1001"
和end tell
之间):
set searchRange to used range
try
set foundRange to find searchRange what "blurp" with match case
(* do something with the foundRange *)
on error -- not found
(* do error handling *)
end try
如果找到"blurp"
,则会返回一个范围(类似range "'[Workbook1]1001'!$D$4" of application "Microsoft Excel"
),否则会抛出错误(这意味着找不到您搜索到的内容)。