ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] Excel vba get dynamic range( fields) to create the line chart

[µo°Ý] Excel vba get dynamic range( fields) to create the line chart

I have  the same problem on stackoverflow
I export an excel with a table in sheet1,and have a graph in sheet2, but now I have one problem, the table was generated from store procedure,the fields:"2013/Q1 2013/Q2 2013/Q3 2013/Q4 " was dynamic AND also the statistic values which display by user choose from webpage,now,the exported graph (Line Chart) ,its X-axis includes the statistic values that I dont need the fields( sheet2 ),
I want to get the range "B1" to "E11"( the cell is dynamic,so we dont get the position of the cell exactly), and all the title fields and data of row and column were dynamic , how can I write the correct VBA to do it, thanks
sheet1


sheet2

I want to output the line chart:

TOP

¦^´_ 3# stillfish00


    Hello,stillfish00
I wrote  the VBA  code  ,Can you modify code for code segment in attachment
myexp.rar (16.56 KB)

TOP

¦^´_ 5# Hsieh
Thanks for your idea ,the last column is located at "E column" (dynamic, maybe F,G...column),
because the statistics could not display,and the field like "2013/Q3",that have 2 type, the other type like "2013/4m",
so I want to get the range from "B1" to the last address of column type1 or type2

TOP

¦^´_ 6# c3676816

it could be like this format

TOP

¦^´_ 8# GBKEE

hello,GBKEE,
I want to know how do you set the data source to create graph,
recompile have some wrong

TOP

@GBKEE
I fix it,thanks for your kindness
@stillfish00
THIS idea run at an independent excel file so perfect,thank you so much

TOP

        ÀR«ä¦Û¦b : µêªÅ¦³ºÉ¡D§ÚÄ@µL½a¡AµoÄ@®e©ö¦æÄ@Ãø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD