rename worksheets based on list

qontrol

New Member
Joined
Apr 16, 2014
Messages
14
Hello everyone,

I have a bunch of worksheets as from sheet2 to sheet35.

I need to rename them based on a list in sheet1 named "List" starting from cell A2.

I've already found this, but it doens't work:

Code:
Sub rename()


Dim lr As Long


lr = Sheets("List").Cells(Rows.Count, 1).End(xlUp).Row


For i = 2 To Worksheets.Count
    Worksheets(i).Name = Worksheets("List").Range("A2:A" & lr).Value


Next


End Sub

Any help is appreciated!

Thanks
 
Last edited:

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
I think the line that renames the sheet should be:
Code:
Worksheets(i).Name = Worksheets("List").Range("A" & lr).Value
 
Upvote 0
How about
Code:
Worksheets(i).Name = Worksheets("List").Range("A" & i).Value
 
Upvote 0

Forum statistics

Threads
1,223,639
Messages
6,173,499
Members
452,517
Latest member
SoerenB

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