DisplayNullString 属性 (Excel)PivotTable.DisplayNullString property (Excel)

如果数据透视表在包含空值的单元格中显示用户自定义的字符串,则该值为 TrueTrue if the PivotTable report displays a custom string in cells that contain null values. 默认值为 TrueThe default value is True. 读/写 BooleanRead/write Boolean.

语法Syntax

表达式DisplayNullStringexpression.DisplayNullString

_表达式_一个代表**PivotTable** 对象的变量。expression A variable that represents a PivotTable object.

注解Remarks

使用**NullString** 属性可设置自定义的 null 字符串。Use the NullString property to set the custom null string.

示例Example

本示例使数据透视表在包含空值的单元格中显示“NA”。This example causes the PivotTable report to display "NA" in cells that contain null values.

With Worksheets(1).PivotTables("Pivot1") 
 .NullString = "NA" 
 .DisplayNullString = True 
End With

本示例使数据透视表在包含空值的单元格中显示零 (0)。This example causes the PivotTable report to display 0 (zero) in cells that contain null values.

Worksheets(1).PivotTables("Pivot1").DisplayNullString = False

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.