【发布时间】:2016-06-03 18:24:47
【问题描述】:
所以这是我正在使用的代码:
c = Application.Match("Test", Range("F1:F130"), 0)
ActiveChart.SeriesCollection(1).XValues = "='" & shtname & "'" & "!$B$104:$N$104"
与我想说的情节非常相似,因为 c+4 = 一些整数,并不总是 104。
ActiveChart.SeriesCollection(1).XValues = "='" & shtname & "'" & "!$B$(c+3):$N$(c+3)"
我尝试过使用类似的方法:
ActiveChart.SeriesCollection(1).XValues = "='" & shtname & "'" & "!$B$" & " (c+3):$N$" & " (c+3) "
这不起作用......显然,但我对 VBA 和语法非常陌生,因此感谢任何帮助。 这里也是 shtname 的函数:
Function shtname() As String
shtname = ActiveSheet.Name
End Function
【问题讨论】:
-
尝试 ActiveChart.SeriesCollection(1).XValues = "='" & shtname & "'!$B$" & (c+3) & ":$N$" & ( c+3)
-
@MutjayLee 这是一个行号
-
@MutjayLee 就像一个魅力,提交它作为答案,我会接受它