简体   繁体   English

当我从数据选项卡中获取 Excel 数据时,如何写回源 excel 文件?

[英]How can I write back to source excel files when I get Excel data from data tab?

So, I want to create one Excel file each for every manager with only one single sheet and place it on OneDrive.因此,我想为每位经理创建一个 Excel 文件,每个文件只有一张纸,并将其放在 OneDrive 上。

In order to get the data in one place, I am creating another excel file called combined.xlsx.为了在一个地方获取数据,我正在创建另一个名为 combined.xlsx 的 excel 文件。

Now, I can export each workbook to a tab using Data -> Get Data -> From File -> From Workbook.现在,我可以使用“数据”->“获取数据”->“从文件”->“从工作簿”将每个工作簿导出到一个选项卡。

This is great so far.到目前为止这很棒。 So, I can read data of 10 excelfiles on 10 sheets in combined.xlsx.因此,我可以在 combined.xlsx 中的 10 张纸上读取 10 个 excel 文件的数据。

Now, I want to modify contents of one of the tabs and make sure it is reflected to the original file.现在,我想修改其中一个选项卡的内容并确保它反映到原始文件中。 How can I do this?我怎样才能做到这一点?

This is not possible unfortunately.不幸的是,这是不可能的。

To elaborate on why it is not possible, you need to understand how Power Query deals with data:要详细说明为什么不可能,您需要了解 Power Query 如何处理数据:

  • You load your data into Power Query via the "Data" tab.您可以通过“数据”选项卡将数据加载到 Power Query 中。 The source can be anything Microsoft allows.源可以是 Microsoft 允许的任何内容。
  • You then manipulate the data any which way in Power Query.然后,您可以在 Power Query 中以任何方式操作数据。
  • As a last step, you decide if and where to load the results.最后一步,您决定是否加载结果以及加载结果的位置。 If you only want to create a connection to the query, you select "Close and Load to", which appears after you click on the arrow next to "Close and Load", and you pick that.如果您只想创建与查询的连接,您可以单击 select“关闭并加载到”,它会在您单击“关闭并加载”旁边的箭头后出现,然后选择它。 Otherwise, the only other options are loading the query results to a table, PivotTable report, PivotChart.否则,唯一的其他选项是将查询结果加载到表、数据透视表、数据透视图中。
  • Because the output sheets you have are connected to the query that produced them, any time you refresh the query, whatever manual changes you have made in the table that the query created originally will be wiped out and overwritten with the refreshed data.因为您拥有的 output 表已连接到生成它们的查询,所以每次刷新查询时,您在查询最初创建的表中所做的任何手动更改都将被清除并被刷新的数据覆盖。
  • If you were able to write back to the source here, you'd in effect create a circular reference.如果您能够在此处写回源代码,您实际上会创建一个循环引用。

Check out this article about having Power Query output your data after manipulating it, maybe it helps. 查看这篇关于在处理数据后使用 Power Query output 的文章,也许它有帮助。

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

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