谢谢你的帮助。我正在尝试更改N列中包含音乐曲目子类别的单元格,如果代码在R列中找到了我要查找的曲目标题
-- Declare variables
property searchTrackTitle : ""
property newSubCategory : ""
-- Display input box to get search term
display dialog "Enter the track title that you want to search for:" default answer ""
set searchTrackTitle to text returned of result
-- Display input box to get new SubCategory
display dialog "Enter the new SubCategory that you want to use:" default answer ""
set newSubCategory to text returned of result
-- Open Excel and set variables
tell application "Microsoft Excel"
activate
set sh to active sheet
set rng to range "R:R" of sh
end tell
-- Loop through each cell in the range
repeat with cell in rng
-- Check if the cell value matches the search term
if value of cell is searchTrackTitle then
-- Update the keywords for the track title
set value of cell "N" of sh to newSubCategory
end if
end repeat
1条答案
按热度按时间qcbq4gxm1#
在Excel中,您在作业结束前输入“end tell”,并尝试使用正确的代码将变量赋给类名: