简体   繁体   English

自动更新图形-Excel

[英]Automatically update graph - Excel

I am trying to make an automatically updating graph. 我正在尝试制作一个自动更新的图形。 This is what I am tring to do: 这是我想做的事情:

I am updating my data every day. 我每天都在更新我的数据。 So let's say I have the number 3000. I want today's date linked with that number. 假设我有数字3000。我希望今天的日期与此数字相关联。

So on 27-10 - 3000. And I want to add data every day. 所以27-10-3000。我想每天添加数据。 So on 28-10 it's 3010. etc. etc. 所以在28-10上是3010,等等。

But I want to do this automatically. 但我想自动执行此操作。 So every day the graph automatically adds the new data with current date. 因此,图表每天都会自动添加具有当前日期的新数据。

I am unfamiliar with graphs and no clue how to do this. 我不熟悉图形,也不知道如何执行此操作。 The only thing I know is the function TODAY() and that the data is always in a single cell: I8. 我唯一知道的是函数TODAY(),数据始终在单个单元格中:I8。

Any Help is much appreciated :) 任何帮助深表感谢 :)

  1. Create a dynamic named range for your data (using OFFSET to dynamically include all new values). 为数据创建一个动态的命名范围(使用OFFSET动态包含所有新值)。 Example: http://analystcave.com/excel-dynamic-named-range/ 示例: http//analystcave.com/excel-dynamic-named-range/

  2. Create a pivot table based on that data 根据该数据创建数据透视表

  3. Make a macro for refreshing the Pivot Table when data is updated (can record it with Macro Recorder) eg 制作一个宏,以便在数据更新时刷新数据透视表(可以用Macro Recorder记录),例如

See example below: 请参见下面的示例:

ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh

You can add this macro to the ActiveSheet change event or better even add a button to refresh the chart. 您可以将此宏添加到ActiveSheet更改事件中,甚至可以添加一个按钮来刷新图表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM