Changing names on worksheet tabs quickly

AntBlabby8

Board Regular
Joined
Apr 18, 2002
Messages
200
I am setting up a budget 2012 workbook. I am simply doing a Save As from my 2011 file, because the 2012 file will be using the same names on all 32 worksheets that I have for my 2011 workbook and starting with the same templates on each worksheet. The name of each tab will be WorksheetName 2012. Every single one of them will have to say 2012. All of them will say, however, 2011. Is there a way to change them ALL to 2012 at once without having to do a name change for each tab, one at a time?

THANKS
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Code:
Sub SheetNames()
Dim ws As Worksheet
Dim Yr As Integer


Yr = InputBox("Please enter year to be replaced", "Renaming Sheets", Year(Date))

For Each ws In ThisWorkbook.Worksheets
    If InStr(1, ws.Name, Yr, 1) > 0 Then ws.Name = Replace(ws.Name, Yr, Yr + 1)
Next ws


End Sub
 
Upvote 0

Forum statistics

Threads
1,224,606
Messages
6,179,865
Members
452,948
Latest member
UsmanAli786

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