vba update pivot items
<p>i have a report that goes through and changes various pivot fields and copies some of the data to another sheet. I made a macro for it that works, however it is essentially just the results of recorded my clicks. I would like to write a sub that I can pass in a pivot table, pivot field and an pivot item name and have it update the fields that way instead of copying and pasting the actions over and over. Here is one piece of it that sets three filters in the pivot table.</p>

<pre><code>`Worksheets("Closed Pivot").Activate
With ActiveSheet.PivotTables("PivotTable5").PivotFields("Business")
        .PivotItems("NEW").Visible = True
        .PivotItems("Pre-Paid Maint").Visible = False
        .PivotItems("Renewal").Visible = False
        .PivotItems("Training / Pro Svc").Visible = False
        .PivotItems("Upsell/Cross-sell").Visible = False
        .PivotItems("(blank)").Visible = False
        .PivotItems("#N/A").Visible = False
    End With
            ActiveSheet.PivotTables("PivotTable5").PivotFields("Stage"). _
        EnableMultiplePageItems = True
    With ActiveSheet.PivotTables("PivotTable5").PivotFields("Revenue Channel")
        .PivotItems("2-Tier Distributor").Visible = True
        .PivotItems("Direct Sales").Visible = True
        .PivotItems("Direct VAR").Visible = True
        .PivotItems("Ecommerce").Visible = True
        .PivotItems("Maintenance Renewal").Visible = True
        .PivotItems("(blank)").Visible = True
    End With

    With ActiveSheet.PivotTables("PivotTable5").PivotFields("Stage")
        .PivotItems("Closed Lost").Visible = False
        .PivotItems("Closed Won").Visible = True
        .PivotItems("(blank)").Visible = False
    End With`
</code></pre>