枢轴表过滤来自名称范围
我有这个宏可以将枢轴表滤光到仅在命名范围内的产品。
我一直在考虑一种将枢轴表滤光到名称范围除外的所有内容的方法。
想法?
Sub x()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Worksheets("1").Activate
Dim PI As PivotItem
With Worksheets("1").PivotTables("A").PivotFields("A")
.ClearAllFilters
For Each PI In .PivotItems
PI.Visible = WorksheetFunction.CountIf(Range("WIP"), PI.Name) > 0
Next PI
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
I have this macro that filters a pivot table to only products in a named range.
I've been trying to think of a way to filter the pivot table to everything EXCEPT what's in the names range.
Thoughts?
Sub x()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Worksheets("1").Activate
Dim PI As PivotItem
With Worksheets("1").PivotTables("A").PivotFields("A")
.ClearAllFilters
For Each PI In .PivotItems
PI.Visible = WorksheetFunction.CountIf(Range("WIP"), PI.Name) > 0
Next PI
End With
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论