从VBA中的单元格获取数据透视表句柄 [英] Get pivotTable handle from cell in vba

查看:52
本文介绍了从VBA中的单元格获取数据透视表句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我在每个需要编辑的第三个工作表上都有一个数据透视表,在工作表上有3个数据透视表,我实际上不知道表的名称,但我知道它位于$ N $ 2上,是无论如何要从单元格中获取数据透视表的名称或句柄?

For instance I have a pivot table on every third worksheet that needs to be edited, on the worksheet is 3 pivot tables, I don't actually know the name of the table but I know it lies on $N$2, is there anyway to get the name or handle of the pivot table from the cell?

推荐答案

Range对象具有数据透视表属性,该属性返回所需的对象

The Range object has a PivotTable property that returns the object you want

Set pt = MySheet.Range("N2").PivotTable

这篇关于从VBA中的单元格获取数据透视表句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆