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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
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,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

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