convert a string to range?
JK wrote...
....
Not a programmer, try to write a macro to refresh a chart base on the
range I choose, say, in the previouse step, set "A1:A1, K1:P1, A5:A5,
K5:P5, A10:A10, K10:P10" to string variable wkrange.
then:
ActiveChart.SetSourceData Source:=Sheets("sheet1").range(wkrange), _
PlotBy:=xlRows
I get run-time error '1004'
....
What are the col A cells supposed to contain? If they're data points
like cols K through P, then the problem is that Excel can only plot
single cells, rows or columns, with rows and columns being single area
ranges. Your rows, (A1:A1,K1:P1), (A5:A5,K5:P5), etc are 2-area ranges,
therefore invalid. You'd need to plot A1:P1, A5:P5, etc.
|