Excel VBA Copy new worksheets, and rename them following a specific worksheet

gbailey1996

New Member
Joined
Oct 31, 2016
Messages
2
I have been using the following code to make 12 copies of a master worksheet in the same workbook and rename the worksheets.

The problem is it starts renaming at the beginning of the work workbook. I need it to start renaming the tabs after the master, in this case titled "EOY".

Sub Copier()
Dim x As Integer
x = InputBox("12")
For numtimes = 1 To x
ActiveWorkbook.Sheets("EOY").copy _
Next
For x = 1 To ActiveWorkbook.Sheets.Count
Sheets (x).Name = MonthName(x)
End Sub

Any help would be greatly appreciated.
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Mark80

Board Regular
Joined
Aug 12, 2016
Messages
56
Assuming that the Master is the first worksheet could you not just change the following line of code

Code:
For x = 1 To ActiveWorkbook.Sheets.Count

To this

Code:
For x = 2 to ActiveWorkbook.Sheets.Count
 

Watch MrExcel Video

Forum statistics

Threads
1,118,936
Messages
5,575,110
Members
412,647
Latest member
daviduk001
Top