Excel charts - setting series end dynamically

后端 未结 7 1967
暗喜
暗喜 2020-12-10 07:21

I\'ve got a spreadsheet with plenty of graphs in it and one sheet with loads of data feeding those graphs.

I\'ve plotted the data on each graph using



        
7条回答
  •  鱼传尺愫
    2020-12-10 08:06

    OK, I had to do a little more research, here's how to make it work, completely within the spreadsheet (without VBA):

    Using A1 as the end of your desired range, and the chart being on the same sheet as the data:

    Name the first cell of the data (C5) as a named range, say TESTRANGE.
    Created a named range MYDATA as the following formula:

    =OFFSET(TESTRANGE, 0, 0, Sheet1!$A$1, 1)

    Now, go to the SERIES tab of the chart SOURCE DATA dialog, and change your VALUES statement to:

    =Sheet1!MYDATA

    Now everytime you change the A1 cell value, it'll change the chart.

    Thanks to Robert Mearns for catching the flaws in my previous answer.

提交回复
热议问题