Update Chart Filters Based on Range In Spreadsheet

drmingle

Board Regular
Joined
Oct 5, 2009
Messages
229
Objective: to use a list of items in a specified range to update a pivot chart

I know the code below points to what I am needing, but I think I need to create a variable to step through a range so that I can add them to the code below:
(something like Range = Sheets("Main").Range("A1:A10") for each i in Range update chart)
Code:
Sub updatePivotChart()
    With ActiveChart.PivotLayout.PivotTable.PivotFields("Company*+")
        .PivotItems("Speck Regional").Visible = False
  
    End With


End Sub

By the way, when I mean update chart I want to have the items in the list show up within the graph and the other items excluded. It seems that Excel marks everything as "false", but the items that you want shown.

Any help would be appreciated.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,223,730
Messages
6,174,162
Members
452,548
Latest member
Enice Anaelle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top