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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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