Skip to content
本页内容

DisplayNullString (属性)

如果数据透视表在包含空值的单元格中显示用户自定义的字符串,则该值为 True。默认值为 Truebool 类型,可读写。

说明

使用 NullString 属性可设置自定义空字符串。

示例

python
#本示例使数据透视表在包含空值的单元格中显示“NA”
def test():
    Application.Worksheets.Item(1).PivotTables("Pivot1").NullString = "NA"
    Application.Worksheets.Item(1).PivotTables("Pivot1").DisplayNullString = True
python
#本示例使数据透视表在包含空值的单元格中显示零 (0)
def test():
    Application.Worksheets.Item(1).PivotTables("Pivot1").DisplayNullString = False