简体   繁体   English

Excel-将一张纸复制到所有打开的工作簿

[英]Excel - copy one sheet to all opened workbooks

I am trying to copy one sheet from one workbook to all opened workbooks. 我试图将一张工作簿中的一张纸复制到所有打开的工作簿中。

Workbooks that I want to copy that sheet to are located in many different folders, but I plan to locate them all and open them all. 我要将工作表复制到的工作簿位于许多不同的文件夹中,但是我计划将它们全部找到并全部打开。

Using Excel 2010, I can do that manually for each opened workbook, right click on sheet - move or copy - select ONE of the opened books... what I am tying to accomplish is equivalent to selecting ALL opened workbooks. 使用Excel 2010,我可以为每个打开的工作簿手动执行此操作,右键单击工作表-移动或复制-选择一个打开的工作簿...我要完成的工作等同于选择“所有打开的工作簿”。 Copied sheets could be placed at end of existing sheets. 可以将复制的纸张放置在现有纸张的末端。

Sheet that I want to copy to other workbooks contains links to other sheet in same workbook, but other workbooks that this sheet will be copied to already have a sheet with same name, so that is probably not a problem? 我要复制到其他工作簿的工作表包含指向同一工作簿中其他工作表的链接,但是此工作表将被复制到的其他工作簿已经具有相同名称的工作表,因此这可能不是问题吗?

Thank you! 谢谢!

Found a solution: This macro copies the active sheet to all the open workbooks except the one it's in: 找到了一个解决方案:此宏将活动工作表复制到所有打开的工作簿中,但不包含在其中:

Dim wb As Workbook Dim sh As Worksheet 昏暗的工作簿昏暗的工作簿

Set sh = ActiveSheet

For Each wb In Application.Workbooks
    If Not sh.Parent Is wb Then
        sh.Copy After:=wb.Sheets(wb.Sheets.Count)
    End If
Next wb

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

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