0

我正在尝试为我输入的每个新数据行添加新系列我希望系列的名称在 B 列中,值在 E 到 AH 列中。从 71-206 循环的计数器和 j 变量说明了标题和其他偏移量,因此我将系列与其数据相匹配。

任何帮助将不胜感激。谢谢!

Sub stacked()
'
' stacked Macro
'
Dim i As Integer
Dim j As Integer

For i = 71 To 206
    ActiveChart.SeriesCollection.NewSeries
    j = i + 5
    ActiveChart.SeriesCollection(i).Name = "=Sheet1!B" & j
    ActiveChart.SeriesCollection(i).Values = "=Sheet1!E:AH" & j ":AH"&j
Next i

End Sub
4

1 回答 1

0
Sub stacked()
'
' stacked Macro
'
Dim i As Integer
Dim j As Integer

For i = 71 To 206
ActiveChart.SeriesCollection.NewSeries
j = i + 5
ActiveChart.SeriesCollection(i).Name = "=Sheet1!B" & j
ActiveChart.SeriesCollection(i).Values = "=Sheet1!E" & j & ":AH" & j
Next i

End Sub

小错误,仅此而已!

于 2013-09-19T18:10:37.047 回答