我正在尝试在所有工作表中展开数据透视表上的'TheyYear'列。
当前我有:
For Each ws In ThisWorkbook.Worksheets
For Each Pt In ws.PivotTables
Set Pf = pt.PivotField("[Report vwDimDate].[TheYear].[TheYear]")
Pf.ShowDetail = True
Next
Next
但不幸的是,它不工作,我得到一个运行时错误438对象不支持这个属性方法,有人可以帮助我在这个
谢谢。
我设法让它工作,我调整了VBA:
For Each ws In ThisWorkbook.Worksheets
For Each Pt In ws.PivotTables
Pt.PivotFields("[Report vwDimDate].[TheYear].[TheYear]").DrilledDown = True
Next Pt
Next ws