隐藏列标签"值"在使用VBA的数据透视表中

时间:2016-09-26 12:49:52

标签: excel vba excel-vba pivot-table

如何隐藏列标签" "在使用VBA的数据透视表中?我试图在Google上搜索几个小时,但无济于事。我确实尝试了{ "day" : "2016-10-06", "amountOfEnergy" : 40, "cost" : 120, "content" : [ ], "links" : [ { "rel" : "self", "href" : "http://localhost:8090/boiler/1" }, { "rel" : "bathroom", "href" : "http://localhost:8090/boiler/1" } ] } .Visible.Enable,然后我将它们设置为等于.CompactLayoutColumnHeader,但它返回错误或无法正常工作。我可以通过右键单击然后进入数据透视表选项显示并清除' 显示值行复选框来手动隐藏此标签>',但不知道如何使用VBA执行此操作。

2 个答案:

答案 0 :(得分:2)

根据要求回答评论:

如果您可以手动完成,只需按“录制宏”,执行此操作并检查代码记录的代码。 http://www.excel-easy.com/vba/examples/macro-recorder.html

答案 1 :(得分:1)

ActiveSheet.PivotTables("PivotTbleName").ShowValuesRow = False
相关问题