VB Script : First check to see if value exists in Pivot Table filter list RRS feed

All replies

  • 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
        doesItemExists = False
    End Function

    hope it helps

    • Proposed as answer by Simon Wu-MSFT Tuesday, August 28, 2018 7:51 AM
    Thursday, August 16, 2018 8:49 AM
  • Thanks for you asking. Did you resolved your issue ? If the post helps you, you can mark it as answer and close the post.

    Best Regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Tuesday, August 21, 2018 9:01 AM