Note: The other languages of the website are Google-translated. Back to English
登陆  \/ 
x
or
x
点此注册  \/ 
x

or

如何在Excel中多次复制多张工作表?

有时,我们可能需要在工作簿中制作一个或多个指定工作表的副本。 这里有一些快速的方法来帮助您轻松地在Excel中多次复制一个或多个工作表。


一次将多个工作表的一个副本复制到活动工作簿中,或使用“移动”或“复制”命令将其复制到另一个工作簿中

随着 移动或复制 在Excel中使用命令,您可以一次将一个工作表,多个特定工作表或所有工作表复制到活动工作簿或另一工作簿中。

1。 在要复制工作表的某个工作簿中,在“工作表”选项卡栏上选择多个工作表。
备注:控股 CTRL 键,您可以选择多个不相邻的工作表标签,并在“工作表标签”栏上一一点击它们; 保持 SHIFT 键,可以通过单击“工作表标签”栏上的第一个工作表标签和最后一个工作表标签来选择多个相邻的工作表标签。

2。 右键单击“工作表标签”栏上的选定工作表标签,然后选择 移动或复制 从上下文菜单中。 看截图:
doc复制多张图纸01

3。 在 移动或复制 对话框中,请指定以下设置:
(1)请指定要从中复制工作表的目标工作簿。 预订 下拉列表。 您可以根据需要选择活动的工作簿,另一个打开的工作簿或新的工作簿。
(2)在“图纸选项卡”栏上指定要复制的图纸的位置,您可以在所有现有图纸之后进行选择。
(3)检查 建立副本 选项,如果您不选中此选项,则选定的工作表将被移到目标工作簿中。
(4)点击 OK 按钮。

现在,它将仅将所选工作表复制到指定的工作簿中。 要制作这些工作表的多个副本,您可以多次重复该操作。

只需单击几下即可在活动工作簿中制作多个工作表的多个副本

通常,我们可以使用 移动或复制 Excel中的功能。 但是,此功能一次只能复制一份。 在这里,用Kutools for Excel的 复制工作表 实用程序,只需单击几下,您就可以轻松地在活动工作簿中制作所需数量的多个工作表副本。 全功能30天免费试用!
广告复制多个工作表01

Kutools for Excel -包括300多个用于Excel的便捷工具。 全功能30天免费试用,无需信用卡! 立即行动吧!

使用VBA代码将一个指定工作表的多个副本放入活动工作簿中

如果要复制指定工作表的10个副本,则 移动或复制 命令将是一种耗时的方法,您必须多次重复该操作。 但是,使用以下VBA代码,您可以一次快速地将工作表复制10次。

1。 按住 ALT + F11 键,然后打开 Microsoft Visual Basic应用程序 窗口。

2。 点击 插页 > 模块,然后将以下代码粘贴到“模块窗口”中。

VBA:将某个工作表的多个副本放入活动工作簿中

Sub Copier ()
Dim x As Integer
x = InputBox("Enter number of times to copy Sheet1")
For numtimes = 1 To x
ActiveWorkbook.Sheets("Sheet1").Copy _
After:=ActiveWorkbook.Sheets("Sheet1")
Next
End Sub

备注:在上面的代码中,替换为“Sheet1”和要复制的工作表的名称。

3。 然后按 F5 键以运行代码,将出现一个提示框,询问您所需的印张数量。

4。 然后点击 OK,指定的工作表已在活动工作簿中复制了100次。


使用Kutools for Excel将多个工作表的多个副本制作到活动工作簿中

虽然在Excel中制作多个工作表的副本很简单,但是如果要在当前工作簿中制作多个工作表的多个副本,则可能必须使用 移动或复制 命令项一次又一次。 是否想一键完成? 随着 复制工作表 第三方加载项的实用程序 Kutools for Excel,您可以在Excel中一键制作多个工作表的多个副本。

Kutools for Excel -包括300多个用于Excel的便捷工具。 全功能30天免费试用,无需信用卡! 立即行动吧!

1。 点击 Kutools Plus > 复制工作表。 看截图:

备注:点击 Kutools Plus > 工作表 > 复制工作表 也将获得此功能。

2。 套用设定 复制多个工作表 对话框:
(1)检查要从中复制的工作表 复制所选的工作表 部分。
(2)指定 份数.
(3)确定所复制工作表的位置,例如,在所有工作表之前或之后,当前工作表之前或之后。
(4)点击 Ok 按钮。

3。 弹出提示框,提醒您已根据需要将选中的工作表复制多次,请单击 OK 按钮退出。 看截图:

这篇 复制多个工作表 的特点 Kutools for Excel 只需单击几下,即可在活动工作簿中制作多个指定工作表的多个副本。 免费试用!


将多个工作表中的多个工作表的一个副本复制到一个新的工作簿中

如果您已经安装了Kutools for Excel,也可以应用它 合并工作表 仅需在Excel中单击几下,即可将多个工作表的一个副本从多个关闭的工作簿复制到一个新的工作簿中。

Kutools for Excel -包括300多个用于Excel的便捷工具。 全功能30天免费试用,无需信用卡! 立即行动吧!

1。 点击 Kutools Plus > 结合 激活合并工作表功能。

2。 在[合并工作表–第1步,共3步]向导中,请检查 将工作簿中的多个工作表合并为一个工作表 选项,然后单击 下一页 按钮。 看截图:

3。 在“合并工作表–第2步,共3步”向导中,请执行以下显示的屏幕截图:
(1)点击 加入 > 文件 or 要添加工作簿,您将从中复制工作表。
(2)在 工作簿清单 部分,检查要复制其工作表的工作簿;
(3)在 工作表清单 部分,检查您将复制的工作表;
(4)在上方重复 (2) (3) 从其他工作簿中选择工作表,您将要复制。
(5)点击 下一页 按钮。

4。 在“合并工作表-第3步,共3步”向导中,请根据需要配置复制设置,然后单击 按钮。

5。 现在,在新对话框中,请指定目标文件夹以保存新工作簿,并在 文件名 框,然后单击 优惠 按钮。 看截图:

现在,将出现另外两个对话框,要求您打开新工作簿并保存组合方案,请根据需要单击按钮。 到目前为止,它一次已从多个工作簿复制了所有指定的工作表。

有了这个 合并(工作表) 实用程序,您可以轻松地复制和合并工作表和工作簿,如下所示。 免费试用!
(1)将工作簿中的多个工作表/范围快速组合为一个工作表;
(2)快速将工作簿中所有相同名称的工作表合并/合并为一个工作表;
(3)快速将工作表或工作簿合并/合并为一个工作簿;
(4)将来自多个工作表的数据快速汇总/计算为一个工作表。


最佳办公效率工具

Kutools for Excel解决了您的大多数问题,并使您的生产率提高了80%

  • 重用: 快速插入 复杂的公式,图表 以及您以前使用过的任何东西; 加密单元 带密码 创建邮件列表 并发送电子邮件...
  • 超级公式栏 (轻松编辑多行文本和公式); 阅读版式 (轻松读取和编辑大量单元格); 粘贴到过滤范围...
  • 合并单元格/行/列 不会丢失数据; 拆分单元格内容; 合并重复的行/列...防止细胞重复; 比较范围...
  • 选择重复或唯一 行; 选择空白行 (所有单元格都是空的); 超级查找和模糊查找 在许多工作簿中; 随机选择...
  • 确切的副本 多个单元格,无需更改公式参考; 自动创建参考 到多张纸; 插入项目符号,复选框等...
  • 提取文字,添加文本,按位置删除, 删除空间; 创建和打印分页小计; 在单元格内容和注释之间转换...
  • 超级滤镜 (将过滤方案保存并应用于其他工作表); 高级排序 按月/周/日,频率及更多; 特殊过滤器 用粗体,斜体...
  • 结合工作簿和工作表; 根据关键列合并表; 将数据分割成多个工作表; 批量转换xls,xlsx和PDF...
  • 超过300种强大功能。 支持Office / Excel 2007-2019和365。支持所有语言。 在您的企业或组织中轻松部署。 完整功能30天免费试用。 60天退款保证。
kte选项卡201905

Office选项卡为Office带来了选项卡式界面,使您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
officetab底部
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Tyler Dempsey · 3 years ago
    I am new to this I am just trying to make copies of the same sheet this is the code I am using.

    Sub Copier()
    Dim s As String
    Dim numtimes As Integer
    Dim numCopies As Integer
    numCopies = InputBox("How many copies do you need?")
    s = InputBox("Enter the name of the Worksheet you want to copy")
    For numtimes = 1 To numCopies
    ActiveWorkbook.Sheets(s).Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
    Next
    End Sub

    when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.
    • To post as a guest, your comment is unpublished.
      Jorge · 1 years ago
      Working Code

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub

      copy the entire line from ActiveWorkbook.Sheets...... that was the problem, and some spaces

      Have a great day
    • To post as a guest, your comment is unpublished.
      Schuyler · 3 years ago
      [quote name="Tyler Dempsey"]I am new to this I am just trying to make copies of the same sheet this is the code I am using.

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
      Next
      End Sub

      when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.[/quote]


      Here is the exact code you want to use:


      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub
      • To post as a guest, your comment is unpublished.
        Belva · 2 months ago
        Thank you, the last one saved my life :)
    • To post as a guest, your comment is unpublished.
      Schuyler · 3 years ago
      [quote name="Tyler Dempsey"]I am new to this I am just trying to make copies of the same sheet this is the code I am using.

      Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt)
      Next
      End Sub

      when i use the code it gives me the error of "Syntax Error" then this text turns red ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Cou nt) and the is text turns yellow Sub Copier() what can i do to fix it.[/quote]


      Double check your code and make sure you don't have a space at ActiveWorkbook. Sheets(s).Copy _ or at Sheets(Worksheets.Cou nt)
  • To post as a guest, your comment is unpublished.
    Simon · 4 years ago
    Fantastic VBA code - really helped
  • To post as a guest, your comment is unpublished.
    Barry · 4 years ago
    When I first tried it, I got the error message because I didn't change the name Sheet1. After I realized what caused the error, I researched a little further, as I did not want to be manually entering the sheet name into the macro. And when I need this feature, it is almost always for the current sheet.

    I added the line a = activesheet.name
    And revised the line after:=activeworkbook.sheets("sheet1") to activeworkbook.sheets(a).copy _

    That worked very well, but I did notice the numbering was reversed ... that didn't bother me as I was going to manually rename the new sheets anyway.

    When I saw Schuyler's post, I further revised the line activeworkbook.sheets(a).copy _ to after:=activeworkbook.sheets(worksheets.count)

    I am now satisfied with the result. My finished macro:

    Sub copies()
    Dim x As Integer
    x = InputBox("Enter number of times to copy Sheet1")
    For numtimes = 1 To x
    ActiveWorkbook.Sheets("Sheet1").Copy _
    After:=ActiveWorkbook.Sheets(Worksheets.Count)
    Next
    End Sub

    ---
    All the best, Barry
    • To post as a guest, your comment is unpublished.
      MJ · 2 years ago
      i got syntax error on "After:=ActiveWorkbook.Sheets(Worksheets.Count)


      but i dunno whats wrong... Can u help me please?
    • To post as a guest, your comment is unpublished.
      Kate · 3 years ago
      Thank you so much Barry. Your finished macro is the only thing that worked for me.
  • To post as a guest, your comment is unpublished.
    stalag 17 · 4 years ago
    where i will insert this above code in vba should i create common button then inside ?? regards.
    • To post as a guest, your comment is unpublished.
      Adi · 3 years ago
      Follow the below steps:
      1. Copy the above code
      2. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications window.
      2. Click Insert > Module, and paste the following code in the Module Window.
      4.Then press F5 key to run the code
      5.A prompt box appears to ask you the number of sheet copies you want.
  • To post as a guest, your comment is unpublished.
    Susan · 5 years ago
    I get an error that 'numtimes' is not defined...?
  • To post as a guest, your comment is unpublished.
    Debbi · 5 years ago
    I got the same error as Theou and no one seems to have addressed it. My tabs are already named PO 51, PO 52, etc. and I replaced Sheet1 with PO 51 to copy that and got the subscript error out of range (9)

    I followed Schuyler's code to get the right order, but I still get the error and it's always due to these two lines:

    ActiveWorkbook.Sheets(s).Copy _
    Before:=ActiveWorkbook.Sheets(Worksheets.Count)
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      [quote name="Debbi"]I got the same error as Theou and no one seems to have addressed it. My tabs are already named PO 51, PO 52, etc. and I replaced Sheet1 with PO 51 to copy that and got the subscript error out of range (9)

      I followed Schuyler's code to get the right order, but I still get the error and it's always due to these two lines:

      ActiveWorkbook.Sheets(s).Copy _
      Before:=ActiveWorkbook.Sheets(Worksheets.Count)[/quote]

      Can you include your complete code to make it easier to debug? A "subscript error out of range" usually means that the code references something that doesn't exist. I find this in my own code when I've got a typo or something of that nature.
  • To post as a guest, your comment is unpublished.
    Roy · 5 years ago
    how to copy with same column widths
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      Same column widths as the original Worksheet or do you want all of the column widths to be the same?
  • To post as a guest, your comment is unpublished.
    sadaqat · 5 years ago
    yes it works thanks I have successfully make multiple copies of a single worksheet in same workbook by using vba code thnx a lot.
  • To post as a guest, your comment is unpublished.
    Gopal Krishan · 5 years ago
    Search for word "After" and change it to "Before". This will create copies in right order "Before" Sheet1. The only thing to rememeber is that numbering will always start from (2) as the original sheet will always be counted as 1st copy. Also you can replace "Sheet1" with name of the tab you are trying to copy.
  • To post as a guest, your comment is unpublished.
    juan · 6 years ago
    [quote name="MichaelTadashi"]Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?[/quote]

    Anyone was able to answer this question? I need to create 72 copies, but it would be needed to have them in order (1 throught 72, intead of 72 through 1)

    Thanks!
    • To post as a guest, your comment is unpublished.
      Schuyler · 5 years ago
      [quote name="juan"][quote name="MichaelTadashi"]Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?[/quote]

      Anyone was able to answer this question? I need to create 72 copies, but it would be needed to have them in order (1 throught 72, intead of 72 through 1)

      Thanks![/quote]

      If you want the sheet copies to be in sequential order instead of backwards, change the following line...

      [i]After:=ActiveWorkbook.Sheets[/i][u]("Sheet1")[/u]

      to this...

      [i]After:=ActiveWorkbook.Sheets[/i][u](Worksheets.Count)[/u]

      My completed code looked like the following which uses 2 InputBox prompts to allow for a dynamic copy count and worksheet name..


      [i]Sub Copier()
      Dim s As String
      Dim numtimes As Integer
      Dim numCopies As Integer
      numCopies = InputBox("How many copies do you need?")
      s = InputBox("Enter the name of the Worksheet you want to copy")
      For numtimes = 1 To numCopies
      ActiveWorkbook.Sheets(s).Copy _
      After:=ActiveWorkbook.Sheets(Worksheets.Count)
      Next
      End Sub[/i]
      • To post as a guest, your comment is unpublished.
        Karsten · 4 years ago
        How do i get the coppies continuous numbered. If the sheet i want to copy is named I002, and i want the next to be named I003,I004,I005 an so on.
  • To post as a guest, your comment is unpublished.
    Lim · 6 years ago
    Wow, thanks for the VBA code. It really helps a lot!
  • To post as a guest, your comment is unpublished.
    Dee · 6 years ago
    thanks, the vba code was huge
  • To post as a guest, your comment is unpublished.
    Theou Aegis · 6 years ago
    I tried the VBA code and got subscript out of range error (9). I replaced the sheet name with anything I could think of that was in the workbook already. Any idea what I did wrong?

    Also, is there a way to make it name each sheet incrementally? This would tie in with Michael's question, I'm sure. I'm guessing the answer to his question would be you'd need to set the After target to "sheet"+x somehow and that in turn would apply to my question if there was a way to specify what to name the new sheet. I could always just change my boss' "master" to "Aug 0" or whatever month it is, but it'd be easier for her to understand if the script did the naming automatically.
  • To post as a guest, your comment is unpublished.
    MichaelTadashi · 7 years ago
    Using the VBA code, the naming of the duplicated worksheets is in reverse order. Let's say I make 10 copies of Sheet1, I'll end up with Sheet1, Sheet1(10), Sheet1(9), Sheet1(8),.......is it possible to have them in normal order?