Skip to content
本页内容

NumberFormat (属性)

返回或设置一个 Any 值,它代表对象的格式代码。

说明

如果指定区域中的所有单元格包含不同的数字格式,则此属性返回 None

格式代码与**“设置单元格格式”对话框中的“格式代码”**选项是同一个字符串。Format 函数使用的格式代码字符串与 NumberFormatNumberFormatLocal 属性使用的格式代码字符串不同。

示例

python
#此示例显示查找条件的格式代码
def test():
    print(Application.FindFormat.NumberFormat)
python
#此示例设置替换条件的格式代码
def test():
    Application.ReplaceFormat.NumberFormat = "0.00"