VB脚本:首先检查数据透视表过滤器列表中是否存在值 [英] VB Script : First check to see if value exists in Pivot Table filter list

查看:55
本文介绍了VB脚本:首先检查数据透视表过滤器列表中是否存在值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

....

解决方案

尝试在每个要设置的项目之前调用此函数


公共函数doesItemExists(pf As PivotField,value As String)


Dim pi As PivotItem

For each pi In pf.PivotItems
如果pi.Name = value则
doesItemExists = True:退出函数
结束如果
下一个

doesItemExists = False

结束函数

希望它帮助


....

解决方案

try to call this function before each item you want to set

Public Function doesItemExists(pf As PivotField, value As String)


    Dim pi As PivotItem
    
    For Each pi In pf.PivotItems
        If pi.Name = value Then
            doesItemExists = True: Exit Function
        End If
    Next
    
    doesItemExists = False

End Function

hope it helps


这篇关于VB脚本:首先检查数据透视表过滤器列表中是否存在值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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