【问题标题】:Hide Entire PivotTable with VBA Makro使用 VBA Makro 隐藏整个数据透视表
【发布时间】:2015-02-05 12:55:18
【问题描述】:

我只需要一个隐藏整个数据透视表的宏。 数据透视表名称 = PivotTable4

提前致谢

问候

With ActiveSheet.PivotTables("PivotTable4").PivotFields("Average of Server Respond Time")
For x = 3 To .PivotItems.Count
    If Left(.PivotItems(x).Value, 1) = "1" Then
         .PivotItems(x).Visible = False
    End If
Next x
End With

我试过这个,删除一列又一列

【问题讨论】:

  • 你已经尝试了什么?
  • With ActiveSheet.PivotTables("PivotTable4").PivotFields("Average of Server Respond Time") For x = 3 To .PivotItems.Count If Left(.PivotItems(x).Value, 1) = "1" Then .PivotItems(x).Visible = False End If Next x End With
  • 那么,代码有什么问题?结果如何?

标签: vba excel pivot pivot-table


【解决方案1】:

类似的东西:

Dim PT As PivotTable
Set PT = ActiveSheet.PivotTables(1)

'hide whole rows
PT.TableRange2.EntireRow.Hidden = True
'or hide whole columns
PT.TableRang2.EntireColumn.hidden = true
'or clear
PT.TableRang2.clear

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-29
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    相关资源
    最近更新 更多