Copying Excel Sheet Multiple Times

Zedrick13

Board Regular
Joined
Sep 8, 2018
Messages
100
Is there faster way of creating multiple copies of a certain sheet on the same workbook rather than the conventional way of copy a sheet one at a time?

Regards,
Zed
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
.
There are a number of ways to accomplish the goal. Here is one.

Save a workbook with just one sheet named TEMPLATE.

In A1 enter "New Sheet Name"
In A2 is the location where you will enter the name of the new sheet you are adding.
Place a command button on the TEMPLATE sheet connect to the macro below.

You can create one new sheet at a time. The


Code:
Option Explicit


Sub CreateNew()
Dim wsRecipes As Worksheet, wsTEMP As Worksheet, wasVISIBLE As Boolean
Dim shNAMES As Range, Nm As Range
Dim i As Long
Dim wsIndex
On Error Resume Next




With ThisWorkbook                                               'keep focus in this workbook
Application.CopyObjectsWithCells = False
    Set wsTEMP = .Sheets("Template")                            'sheet to be copied
    wasVISIBLE = (wsTEMP.Visible = xlSheetVisible)              'check if it's hidden or not
    If Not wasVISIBLE Then wsTEMP.Visible = xlSheetVisible      'make it visible
      
    Application.ScreenUpdating = False                          'speed up macro


    wsTEMP.Copy After:=.Sheets(.Sheets.Count)                   '...create it from template
    
    wsIndex.Activate                                            'return to the master sheet
    If Not wasVISIBLE Then wsTEMP.Visible = xlSheetHidden       'hide the template if necessary
    Application.ScreenUpdating = True                           'update screen one time at the end


Application.CopyObjectsWithCells = True
End With
Sheets(Sheets.Count).Select


Dim tabname As String
tabname = Sheets("Template").Range("A2").Value
ActiveSheet.Name = tabname
ActiveSheet.Range("A1:A2").Value = ""
Sheets("Template").Range("A2").Value = ""
MsgBox "New sheet created. "
End Sub
 
Upvote 0
Try this:

This script assumes you want to make copies of a sheet named "Master"
Modify as needed.

Code:
Sub Copy_Sheets()
'Modified 1/21/2019 9:34:49 PM  EST
Application.ScreenUpdating = False
Dim i As Long
Dim ans As Long
ans = InputBox("Enter number copies you want")
    For i = 1 To ans
        Sheets("Master").Copy After:=Sheets(Sheets.Count)
        ActiveSheet.Name = "Master" & ActiveSheet.Index
    Next
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top