Use a List of Existing worksheet names and update them based on new list

jamiecobbey

New Member
Joined
May 11, 2018
Messages
1
I have a list of existing worksheet names in A1:A50 (although the worksheets themselves are NOT in that order) and a list of new names I want to update each sheet to in B1:B50. I would like to run a macro that looks for the worksheet name in A1, finds it in the workbook and then renames it to B1 and then continue down the list.

First time posting here - really appreciate any help
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi & welcome to MrExcel.
How about
Code:
Sub ChangeNames()
   Dim Cl As Range
   
   For Each Cl In Sheets("[COLOR=#ff0000]List[/COLOR]").Range("A1:A50")
      If Not IsEmpty(Cl) Then
         If Evaluate("isref('" & Cl.Value & "'!a1)") Then Sheets(Cl.Value).Name = Cl.Offset(, 1).Value
      End If
   Next Cl
End Sub
Change sheet name in red to suit
 
Upvote 0
Run this with the sheet your list is on the active sheet:
Code:
Sub RenameSheets()
Dim V As Variant, i As Long
V = ActiveSheet.Range("A1:B50").Value
Application.ScreenUpdating = False
For i = LBound(V, 1) To UBound(V, 1)
    On Error Resume Next
    Sheets(V(i, 1)).Name = V(i, 2)
    On Error GoTo 0
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,608
Messages
6,120,500
Members
448,968
Latest member
screechyboy79

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