使用VBA脚本刷新多个数据透视表范围 [英] Refresh Multiple Pivot Table Ranges with VBA script

查看:391
本文介绍了使用VBA脚本刷新多个数据透视表范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我已经阅读了有关此主题的现有帮助,但我太生疏了,无法让它在技术上运作。我有点需要我的手持,因为我不记得任何VB语法。

I've read through the existing help on this topic but am too rusty to get it working technically. I sort of need my hand held because I don't recall any VB syntax.

我的数据透视表源数据在工作表"原始数据"中。我的数据透视表在许多工作表中很多。我可以在每张工作表或每个工作簿上使用脚本吗?

My pivot table source data is in sheet "raw data" my pivot tables are many across many worksheets. Can I have a script work per sheet or per workbook?

原始数据的更新只是工作表上的大范围"原始数据"

The update to the raw data is only the large range on sheet "raw data"

推荐答案

看看你是否这样做:

See if this does that you want:

Sub UpdatePivots()

     Dim pvc As PivotCache

    For Each pvc In ActiveWorkbook.PivotCaches

        pvc.Refresh

   下一个pvc

End Sub

Sub UpdatePivots()
    Dim pvc As PivotCache
    For Each pvc In ActiveWorkbook.PivotCaches
        pvc.Refresh
    Next pvc
End Sub


这篇关于使用VBA脚本刷新多个数据透视表范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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