excelguy
excelguy

Reputation: 1624

VBA, select all chart filter

How do I select all for chart filters?

Filtering out in vba is

  ActiveChart.ChartGroups(1).FullCategoryCollection(1).IsFiltered = True

and filtering in is

ActiveChart.ChartGroups(1).FullCategoryCollection(1).IsFiltered = False

The above is done for 1 data point, But how do you select all to filter in(or select all)

Upvotes: 1

Views: 1800

Answers (1)

Jon Peltier
Jon Peltier

Reputation: 6063

You need to loop through them all:

Sub UnfilterCategories()
  Dim iCat As Long, nCat As Long
  With ActiveChart.ChartGroups(1)
    nCat = .FullCategoryCollection.Count
    For iCat = 1 To nCat
      .FullCategoryCollection(iCat).IsFiltered = False
    Next
  End With
End Sub

Upvotes: 2

Related Questions