可以改变图表类型的动态图表

First, take a look at the chart that you will be creating.

可以改变图表类型的动态图表_第1张图片

Feeling excited? read on to learn how to create this.

Solution – Creating Interactive chart in Excel

  1. First create all the charts you want and place them in separate locations in your worksheet. Lets say your charts look like this.
    可以改变图表类型的动态图表_第2张图片
  2. Now, select all the cells corresponding to first chart, press ALT MMD (Formula ribbon > Define name). Give a name like Chart1.
    可以改变图表类型的动态图表_第3张图片
  3. Repeat this process for all charts you have, naming them like Chart2, Chart3
  4. In a separate range of cells, list down all chart names. Give this range a name like lstChartTypes.
  5. Add a new sheet to your workbook. Call it “Output”.
  6. In the output sheet, insert a combo-box form control (from Developer Ribbon > Insert > Form Controls)
    可以改变图表类型的动态图表_第4张图片
  7. Select the combo box control and press Ctrl+1 (format control).
  8. Specify input range as lstChartTypes and cell link as a blank cell in your output sheet (or data sheet).

     

    可以改变图表类型的动态图表_第5张图片

  9. Now, when you make a selection in the combo box, you will know which option is selected in the linked cell.
    可以改变图表类型的动态图表_第6张图片
  10. Now, we need a mechanism to pull corresponding chart based on user selection. Enter a named range –selChart.
  11. Press ALT MMD or go to Formula ribbon > Define name.  Give the name as selChart and define it as
    =CHOOSE(linked_cell, Chart1, Chart2, Chart3, Chart4)
    PS: CHOOSE formula will select one of the Chart ranges based on user’s selection (help).
  12. Now, go back to data & charts sheet. Select Chart1 range. Press CTRL+C to copy it.
  13. Go to Output sheet and paste it as linked picture (Right click > Paste Special > Linked Picture)
    可以改变图表类型的动态图表_第7张图片
  14. This will insert a linked picture of Chart 1.
  15. Now, click on the picture, go to formula bar, type =selChart and press enter
  16. Move the image around, position it nicely next to the combo box.
  17. Congratulations! Your interactive chart is ready :)

文件下载: http://vdisk.weibo.com/s/z2HIs

你可能感兴趣的:(可以改变图表类型的动态图表)