将单元格格式化为数字types“百分比”

我正在尝试在Microsoft Excel中将范围“C3:C8”格式化为数字格式百分比。 下面的代码不起作用,我不确定为什么。 运行脚本后,范围“C3:C8”保持格式化为“常规”

我正在使用Excel for Max 2011和Applescript Editor版本2.7

set formatRange to range "C3:C8" of sheet "Sheet1" set number format of (formatRange of (sheet "Sheet1" of active workbook)) to "Percentage" 

 tell application "Microsoft Excel" front document activate set formatRange to range "C3:C8" of sheet "Sheet1" of active workbook set number format of formatRange to "###.00%" end tell 

单元格值1将转换为100.00%,单元格值0.02将变为2.00%当然,如果您只需要一个十进制数字,则可以使用“###。0%”更改string“###。00%”。

找出一个解决scheme…或至less暂时的解决方法

设置范围“C3:C8”的值为“0%” – 这将自动将格式设置为百分比

将范围“C3:C8”的值设置为“” – 此时将把每个单元格的值设置为空白,但将格式保留为百分比