How can I hide a pivot-table with VBA?
如何使用VBA隐藏数据透视表?
I tried accessing:
我试着访问:
.PivotTables(index).Visible
.PivotTables .Visible(指数)
But there is no Visible
property for the PivotTable
object.
但是,数据透视表对象没有可见的属性。
I need to hide these pivot-tables if the user changes some check-boxes. Maybe I can hide them behind a white box, but in my opinion, this isn't a good solution.
如果用户更改了一些复选框,我需要隐藏这些数据透视表。也许我可以把它们藏在一个白色的盒子里,但在我看来,这不是一个好的解决方案。
If you can't help me, then I would do it with the white box.
如果你帮不上忙,我就用白盒子做。
Thank you very much in advance for your answers...
非常感谢你的回答……
1 个解决方案
#1
1
Try:
试一试:
.PivotTables(index).TableRange2.EntireRow.Hidden = True
This will hide all the rows in the pivot table
这将隐藏数据透视表中的所有行。
You could also achieve this by hiding columns
您也可以通过隐藏列来实现这一点。
.PivotTables(index).TableRange2.EntireColumn.Hidden = True
#1
1
Try:
试一试:
.PivotTables(index).TableRange2.EntireRow.Hidden = True
This will hide all the rows in the pivot table
这将隐藏数据透视表中的所有行。
You could also achieve this by hiding columns
您也可以通过隐藏列来实现这一点。
.PivotTables(index).TableRange2.EntireColumn.Hidden = True