主题
ClearTable (方法)
ClearTable方法用于清除数据透视表。清除数据透视表包括删除所有字段以及删除应用于数据透视表的所有筛选和排序。此方法将数据透视表重置为该表刚创建而尚未添加任何字段时的状态。
说明
ClearTable函数不使用任何参数,可用于关系数据透视表和 OLAP 数据透视表。
示例
python
#以下示例清除活动工作表中的数据透视表
def test():
ActiveSheet.PivotTables(1).ClearTable()
python
#本示例删除活动工作表中所有的数据透视表
def test():
for i in range(1, ActiveSheet.PivotTables().Count):
ActiveSheet.PivotTables(i).ClearTable()