我想将数字(0)添加到值中并发现一些麻烦。Excels 宏将此记录为
Sub Makro2()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).XValues = _
"='Sheet'!$C$221;'Sheet'!$C$223;'Sheet'!$C$225"
ActiveChart.SeriesCollection(2).Values = _
"='Sheet'!$B$222;'Sheet'!$B$224;'Sheet'!$B$226"
End Sub
但是当我对我的代码尝试同样的操作时,我得到了错误。
Dim lineSeries1 As Range
Dim lineSeries2 As Range
With ActiveChart.SeriesCollection.NewSeries
.Values = "={0;100}" 'It works
.Name = ""
.XValues = "={0;100}" 'It works
End With
With ActiveChart.SeriesCollection.NewSeries
.Values = lineSeries1 ' + {0} or & SomeCellWithZero.Address
.Name = ""
.XValues = lineSeries2 ' + {0} or & SomeCellWithZero.Address
End With
所以问题是如何将零添加到值?