如何刷新Excel数据透视表

当数据源发生变化时,需要手动或自动刷新Excel数据透视表以查看最新数据。可以通过右键点击数据透视表选择刷新、设置文件打开时自动刷新、使用宏或者基于定时器的自动更新来实现。此外,对于基于OLAP的数据透视表,可以设置连接定时器进行自动刷新。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you change any of the information in a pivot table's source data, the pivot table won't immediately show your latest changes. You have to refresh a pivot table, automatically or manually, to see the latest data.

如果您更改数据透视表的源数据中的任何信息,则数据透视表将不会立即显示您的最新更改。 您必须自动或手动刷新数据透视表才能查看最新数据。

手动刷新数据透视表 (Manually Refresh a Pivot Table)

It's easy to update a pivot table manually:

手动更新数据透视表很容易:

  • Right-click on the pivot table

    右键点击数据透视表
  • Click the Refresh command

    单击刷新命令
Refresh an Excel Pivot Table

NOTE: When you refresh a pivot table, its PivotCache is updated. ALL pivot tables that use the same pivot cache will also be updated.

注意 :刷新数据透视表时,其PivotCache会更新。 使用同一数据透视表缓存的所有数据透视表也将被更新。

打开文件时刷新 (Refresh When File Opens)

You can also set a pivot table to update automatically when file opens. Just follow these steps to change a pivot table setting:

您还可以将数据透视表设置为在文件打开时自动更新。 只需按照以下步骤更改数据透视表设置:

  • Right-click a cell in the pivot table

    右键单击数据透视表中的单元格
  • Click on PivotTable Options

    单击数据透视表选项
  • Click the Data tab

    点击数据标签
  • In the PivotTable Data section, add a check mark to "Refresh data when opening the file"

    在数据透视表数据部分中,在“打开文件时刷新数据”上添加一个复选标记
  • Click OK, to save the option setting

    单击确定,保存选项设置

使用数据透视表宏 (Use Pivot Table Macros)

Another way to update a pivot table is with macros. For example, use an Excel macro to automatically refresh a pivot table when the pivot table's worksheet is activated.

更新数据透视表的另一种方法是使用宏。 例如,在激活数据透视表的工作表后,使用Excel宏自动刷新数据透视表。

There are sample macros on my Contextures site, to update one pivot table, or multiple pivot tables.

我的Contextures网站上有示例宏,用于更新一个或多个数据透视表。

Go to the Excel Pivot Table Refresh page to get the macro examples.

转到“ Excel数据透视表刷新”页面以获取宏示例。

刷新计时器上的数据透视表 (Refresh Pivot Table on a Timer)

If your workbook has OLAP-based pivot tables, you can also update automatically, based on a timer in its connection.

如果您的工作簿具有基于OLAP的数据透视表,您还可以根据其连接中的计时器自动更新。

NOTE: When you created a pivot table, if you added its data to the Data Model, your pivot table is OLAP-based.

注意 :创建数据透视表时,如果将其数据添加到数据模型中,则数据透视表是基于OLAP的。

warning message add data to data model

To set the connection timer to refresh automatically, follow these steps:

要将连接计时器设置为自动刷新,请按照下列步骤操作:

  • On the Excel Ribbon, click the Data tab

    在Excel功能区上,单击“数据”选项卡
  • Click Queries & Connections

    单击查询和连接
  • In the Queries & Connections pane, click the Connections tab

    在“查询和连接”窗格中,单击“连接”选项卡
    • warning message data model properties
  • On the Usage tab, add a check mark for "Refresh every x minutes"

    在“用法”选项卡上,为“每x分钟刷新”添加一个复选标记
    • refresh connection timer
  • Tip: If your source data changes frequently, and the data set isn't too big, use a low number. For other workbooks, use a higher number, so your work isn't delayed while you wait for the connection to refresh

    提示 :如果您的源数据经常变化,并且数据集不太大,请使用较小的数字。 对于其他工作簿,请使用更大的数字,因此在等待连接刷新时不会延迟您的工作

  • Click OK, to save the settings

    单击确定,保存设置

获取样本文件 (Get the Sample File)

For more tips, and to download the sample file, go to the Refresh a Pivot Table page on my Contextures website.

有关更多提示和下载示例文件,请转到Contextures网站上的Refresh a Pivot Table页面

The sample file is in xlsx format, and doesn't contain any macros. The file has 2 pivot tables (Data Model and Normal), so you'll see a connection alert message, when you open the file.

该示例文件为xlsx格式,并且不包含任何宏。 该文件有2个数据透视表(数据模型和常规),因此打开文件时,您会看到连接警报消息。

翻译自: https://contexturesblog.com/archives/2020/01/16/how-to-refresh-an-excel-pivot-table/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值