动态地将两张纸合并为一张 [英] Dynamically combine two sheets into one

查看:110
本文介绍了动态地将两张纸合并为一张的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此有类似的问题:

I have a similar question to this one: Combine 2 Excel tables into one appending the data?

如果我有以下2个工作表:

If I have the following 2 worksheets:

我想要第三张纸,像这样:

I want to have a third sheet that looks like:

如何从原始的两个工作表中创建第三个工作表?如果我在前两个工作表之一中添加一行,那么第三个工作表会自动更新吗?

How do I create the third worksheet from the original two worksheets? If I add a row to one of the first two worksheets, would the third worksheet automatically update?

推荐答案

对两张纸执行以下过程.

Execute the following procedure for both sheets.

  1. 在其中一列中选择一个值.
  2. 转到数据"选项卡,然后在获取和转换"组中选择"From Table".点击确定.
  3. 在查询编辑器中,从下拉菜单中关闭Close & Load to.在主页选项卡上加载.在加载到"对话框中,选择Only Create Connection并单击加载".
  1. Select a value in one of the columns.
  2. Goto the Data tab and select From Table in the Get and Transform group. Click OK.
  3. In the Query Editor select Close & Load to from the dropdown menu Close & Load on the Home tab. In the Load To dialogbox select Only Create Connection and click Load.

对两个工作表都执行完此操作之后,现在您应该在工作簿查询"窗格中看到以下两个查询.

After doing this for both sheets, you should now see the following two queries in the Workbook Queries pane.

  1. 右键单击Table1查询,然后选择追加".在底部的下拉框中选择Table2.点击确定.
  2. 在查询编辑器中,单击关闭并关闭".加载(图标,而不是下拉菜单).

您现在有了想要的表.在向Table1和/或Table2添加行之后,当您单击数据"选项卡上的刷新"按钮时,新表Append1将更新.

You now have the table you wanted. After adding rows to Table1 and/or Table2, the new table Append1 will update when you click the Refresh button on the Data-tab.

这篇关于动态地将两张纸合并为一张的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆