Excel 宏:如何在根据工作表名称创建唯一标识符时将信息从多张工作表复制到一张工作表
这是我的数据集。
表 1:
FirstName LastName Email Phone
james jones [email protected] 555-5555
karen johnson [email protected] 555-5556
tony brown [email protected] 555-5557
表 2:
FirstName LastName Email Phone Goal
james jones [email protected] 555-5555 200
karen johnson [email protected] 555-5556 500
peter white [email protected] 555-5558 1200
表 3:
FirstName LastName Email Phone
karen johnson [email protected] 555-5556
peter white [email protected] 555-5558
tim thomson [email protected] 555-5559
表 4(结果):
FirstName LastName Email Phone Sheet2 Sheet3 Goal
james jones [email protected] 555-5555 yes no 200
karen johnson [email protected], 555-5556 yes yes 500
[email protected]
tony brown [email protected] 555-5557 no no
peter white [email protected] 555-5558 yes yes 1200
tim thomson [email protected] 555-5559 no yes
请参阅表 2 有一些额外的信息,我想保留在最终表中,第一张表不需要在最终表中列出,并且有些人将会有一些不匹配的数据(如上例中的 karen johnson 所示)。对于任何三个匹配的数据点(即 - 第一个 + 最后一个 + 电话或第一个 + 最后一个 + 电子邮件),我们可以假设匹配。
Here is my data set.
Sheet 1:
FirstName LastName Email Phone
james jones [email protected] 555-5555
karen johnson [email protected] 555-5556
tony brown [email protected] 555-5557
Sheet 2:
FirstName LastName Email Phone Goal
james jones [email protected] 555-5555 200
karen johnson [email protected] 555-5556 500
peter white [email protected] 555-5558 1200
Sheet 3:
FirstName LastName Email Phone
karen johnson [email protected] 555-5556
peter white [email protected] 555-5558
tim thomson [email protected] 555-5559
Sheet 4 (result):
FirstName LastName Email Phone Sheet2 Sheet3 Goal
james jones [email protected] 555-5555 yes no 200
karen johnson [email protected], 555-5556 yes yes 500
[email protected]
tony brown [email protected] 555-5557 no no
peter white [email protected] 555-5558 yes yes 1200
tim thomson [email protected] 555-5559 no yes
See that Sheet 2 has some extra information I'd like to keep in the final sheet, the first sheet need not be listed in the final sheet, and that some people will have some unmatching data (as with karen johnson in the example above). With any three matching data points (i.e. - first + last + phone or first + last + email), we can assume a match.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将下面的代码添加到您的工作簿中。运行“MoveDataToSheet4”后,您将获得sheet4 上描述的输出。
Sheet4 的输出如下图所示。
Add the code below to your workbook. After running "MoveDataToSheet4", you will have the output as you describe on sheet4.
The output of Sheet4 will Look like the image below.