Dynamically combine two sheets into one

人盡茶涼 提交于 2020-07-07 14:24:36

问题


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

However, I am not interested in tables, but columns in worksheets.

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?


回答1:


Execute the following procedure for both sheets.

  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. Right-click on the Table1 query and select Append. Select Table2 in the bottom dropdown box. Click OK.
  2. In the Query Editor click Close & Load (the icon, not the dropdown menu).

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.



来源:https://stackoverflow.com/questions/53089536/dynamically-combine-two-sheets-into-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!