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 for Applications 窗口。

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?