在工作表上的所有图表中更改系列名称 [英] Change series name in all charts on a worksheet

查看:123
本文介绍了在工作表上的所有图表中更改系列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在单个工作表上循环遍历每个图表,并重命名第三个系列:

I am trying to loop through each chart on a single worksheet and rename the 3rd series:

With Sheets("Actual Traded Points")
    For Each Chart In .ChartObjects
        Chart.SeriesCollection(3).name = "Actual Traded Points"
    Next Chart
End With

但是Chart对象似乎没有一个seriesCollection对象,我无法解决如何得到它。这样做的正确方法是什么?

But the Chart object doesn't seem to have a seriesCollection object and I cannot work out how to get to it. What is the correct way to do this?

推荐答案

您实际上是循环通过ChartObjects而不是图表。尝试:

You are actually looping through the ChartObjects, not the Charts. Try:

For Each co In .ChartObjects
    co.Chart.SeriesCollection(3).name = "Actual Traded Points"
Next co

这篇关于在工作表上的所有图表中更改系列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆