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.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
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
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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