I have a sheet with lots of standard Excel charts (Not Pivot charts!).
I add data every week and want the charts to show data for the last 4 weeks.
Because I have a lot of charts I want to automatically select the filtered weeks with a macro. Dynamic ranges are not feasible, as there are too many charts with 5 data series each.
When I record a macro and activate the filter for a certain week, I get the following code:
ActiveChart.ChartGroups(1).FullCategoryCollection(76).IsFiltered = True
The problem for me though is that I only know the name of the week I want to see, let's say "2014-32", but I cannot use that name directly:
ActiveChart.ChartGroups(1).FullCategoryCollection("2014-32").IsFiltered = True
produces an error. How can I set the filters when I only know the filter name not the index number?