excel - How do I use a variable within a range for graph plotting? -
i want loop plotting graph using code:
1 = 354 357 2 range((cells(208, 353)), cells(219, 353)).select 3 range(cells(208, i), cells(219, i)).select 4 activesheet.shapes.addchart.select 5 activechart.charttype = xlcolumnclustered 6 ' activechart.setsourcedata source:=range("sheet2!cells(208,354):cells(219,354)") 7 activechart.axes(xlvalue).majorgridlines.select 8 application.windowstate = xlmaximized 9 activechart.applylayout (9) 10 next 11 end sub however, there runtime error in line 6, please?
cheers
in problem line need set correct reference sheet , range of cells. therefore line of code should like:
activechart.setsourcedata source:=sheets("sheet2").range(cells(208,354),cells(219,354))
Comments
Post a Comment