Skip to content
本页内容

NullString (属性)

返回或设置当 DisplayNullStringTrue 时,在包含 None 值的单元格中显示的字符串。默认值为空字符串 ("")。str 类型,可读写。

示例

python
#本示例使数据透视表在包含空值的单元格中显示“NA”
def test():
    Application.Worksheets.Item(1).PivotTables("Pivot1").NullString = "NA"
    Application.Worksheets.Item(1).PivotTables("Pivot1").DisplayNullString = True
python
#本示例使数据透视表在包含空值的单元格中显示 NULL,并弹窗显示此属性
def test():
    ActiveSheet.PivotTables("Pivot1").DisplayNullString = True
    ActiveSheet.PivotTables("Pivot1").NullString = "NULL"
    print(ActiveSheet.PivotTables("Pivot1").NullString)