【发布时间】:2011-02-06 16:40:55
【问题描述】:
如何使用 AppleScript 将“从 A3 到 E3 的单元格”的背景颜色更改为浅灰色?
我仍然希望字体为黑色。
【问题讨论】:
标签: excel macos applescript
如何使用 AppleScript 将“从 A3 到 E3 的单元格”的背景颜色更改为浅灰色?
我仍然希望字体为黑色。
【问题讨论】:
标签: excel macos applescript
此答案有两个注意事项:您没有指定 Excel 的哪个版本,以下是在 v2004 中测试的。
tell application "Microsoft Excel"
set theRange to range "A3:E3"
set interiorObject to interior object of theRange
set color index of interiorObject to 5 -- '5' is only a dummy value; change as needed.
end tell
根据字典,color index 是“颜色被指定为当前调色板的索引值”。换句话说,您安装中浅灰色的颜色索引可能在其他地方有所不同。
【讨论】: