'看一下也许对你有帮助 '在使用之前先要创建 Sub Series() 'Dimension variable x as Integer data type Dim x as Integer Sheets("Sheet1").Select ActiveSheet.ChartObjects(1).Select Selection.Chart.SeriesCollection.Add Source:=Range("A1") '先增加一个 x = Selection.Chart.SeriesCollection.Count '设置要对最后一个进行处理 Selection.Chart.SeriesCollection(x).Values = Array(5, 6, 7) '注意此处进行值,与你的有何不同。 End Sub
'看一下也许对你有帮助
'在使用之前先要创建
Sub Series()
'Dimension variable x as Integer data type
Dim x as Integer
Sheets("Sheet1").Select
ActiveSheet.ChartObjects(1).Select
Selection.Chart.SeriesCollection.Add Source:=Range("A1") '先增加一个
x = Selection.Chart.SeriesCollection.Count '设置要对最后一个进行处理
Selection.Chart.SeriesCollection(x).Values = Array(5, 6, 7) '注意此处进行值,与你的有何不同。
End Sub
如str="5,6,7,8"
ActiveChart.SeriesCollection(1).Values = split(str,",")