(Solved) – VBA code to change/adjust multiple charts’ series names (duplicate column headings)


I have a VBA that creates multiple line charts from a spreadsheet.
Each chart is for a different characteristic which has two columns to calculate 20th and 80th percentiles. As there are multiple columns with the same name, duplicate columns are named 20th Percentile1, 20th Percentile2… etc etc. Like below:column titles

Because of this, after running my graph VBA, I end up with series legends like this:series legend
I was wondering if there was a code that adjusts the series name to exclude the duplicate numbers, so they all have just 20th Percentile and 80th Percentile.

The main issue is, that I have other series like “Min,” “Max,” “Limit A,” and “Limit B.” So I don’t want to change those series. Just the duplicate ones.

Leave a Reply

Your email address will not be published. Required fields are marked *