Rename multiple sheets using a list

Jnagra88

New Member
Joined
Oct 22, 2018
Messages
4
Hi all,

Looking to rename multiple sheets based on a list located in worksheet 'codes' from the range B3:B35...

I hope someone can help!

Many thanks in advance
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Does the list contain the old and new names for the worksheets?
 
Upvote 0
No, it's literally just a list of numbers -

[TABLE="width: 49"]
<colgroup><col></colgroup><tbody>[TR]
[TD="align: right"]785005[/TD]
[/TR]
[TR]
[TD="align: right"]785010[/TD]
[/TR]
[TR]
[TD="align: right"]785015[/TD]
[/TR]
[TR]
[TD="align: right"]785020[/TD]
[/TR]
[TR]
[TD="align: right"]785030[/TD]
[/TR]
[TR]
[TD="align: right"]785031[/TD]
[/TR]
[TR]
[TD="align: right"]785050[/TD]
[/TR]
[TR]
[TD="align: right"]785100[/TD]
[/TR]
[TR]
[TD="align: right"]785105[/TD]
[/TR]
[TR]
[TD="align: right"]785150[/TD]
[/TR]
[TR]
[TD="align: right"]785165[/TD]
[/TR]
[TR]
[TD="align: right"]785210[/TD]
[/TR]
[TR]
[TD="align: right"]785230[/TD]
[/TR]
[TR]
[TD="align: right"]785300[/TD]
[/TR]
[TR]
[TD="align: right"]785305[/TD]
[/TR]
[TR]
[TD="align: right"]785320[/TD]
[/TR]
[TR]
[TD="align: right"]785325[/TD]
[/TR]
[TR]
[TD="align: right"]785340[/TD]
[/TR]
[TR]
[TD="align: right"]785350[/TD]
[/TR]
[TR]
[TD="align: right"]785505[/TD]
[/TR]
[TR]
[TD="align: right"]785510[/TD]
[/TR]
[TR]
[TD="align: right"]785610[/TD]
[/TR]
[TR]
[TD="align: right"]785615[/TD]
[/TR]
[TR]
[TD="align: right"]785775[/TD]
[/TR]
[TR]
[TD="align: right"]785810[/TD]
[/TR]
[TR]
[TD="align: right"]786200[/TD]
[/TR]
[TR]
[TD="align: right"]786400[/TD]
[/TR]
[TR]
[TD="align: right"]786300[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
So which sheet would be renamed with which number from the list?
 
Upvote 0
At present I only have one sheet which is called 'codes' with all those numbers on there. I need new sheets with those numbers if possible
 
Upvote 0
Does this work for you?

Code:
Sub AddWorkSheets()


For i = 3 To 35


    Sheets.Add After:=Worksheets(Worksheets.Count)
    Sheets(Worksheets.Count).Name = Sheets("Codes").Range("B" & i).Value
Next


End Sub
 
Upvote 0
So rather than rename existing sheets you want to add new sheets and use the list for their names?

Try this.
Code:
Dim wsCodes As Worksheet
Dim wsNew As Worksheet
Dim cl As Range

    Set wsCodes = Sheets("Codes")

    For Each cl in wsCodes.Range("B3", wsCodes.Range("B" & Rows.Count).End(xlUp)).Cells
        Set wsNew = ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count)
        wsNew.Name = cl.Value
    Next cl
 
Upvote 0

Forum statistics

Threads
1,223,640
Messages
6,173,503
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