【问题标题】:Add Different Range to Same Series in Chart将不同范围添加到图表中的同一系列
【发布时间】:2021-08-19 18:29:49
【问题描述】:

错误“参数数量错误或属性分配无效”

请帮忙!!

ch.SeriesCollection(1).XValues=sh.Range(Cells(38, 10), Cells(39, 10) &","& Cells(49,10),Cells(50,10))

【问题讨论】:

    标签: excel vba charts


    【解决方案1】:

    我想这就是你想要的。

        ch.SeriesCollection(1).XValues = sh.Range( _
                                            sh.Range(sh.Cells(38, 10), sh.Cells(39, 10)).Address & _
                                            "," & _
                                            sh.Range(sh.Cells(49, 10), sh.Cells(50, 10)).Address _
                                         )
    

    但最好写成这样:

        ch.SeriesCollection(1).XValues = Union( _
                                            sh.Range(sh.Cells(38, 10), sh.Cells(39, 10)), _
                                            sh.Range(sh.Cells(49, 10), sh.Cells(50, 10)) _
                                         )
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-16
      • 1970-01-01
      • 2015-07-22
      • 2022-01-04
      相关资源
      最近更新 更多