Rename Workheet Names in File

WESTERNWALL

Board Regular
Joined
Oct 8, 2002
Messages
204
Office Version
  1. 365
Platform
  1. MacOS
Hi

I have workbooks in which there a number of worksheets. Each time I save a new file from the previous one I need to change the names on each worksheet tab. Each name is different. Some are days of the month, for instance. In that example I have 31 tabs that need to be renamed 01 March, 02 March, etc. Possibly have a list of tab names (that can be changed at will) on a separate worksheet that are Range Named and link that to the Macro. Just a thought.

Many thanks

Western
 
@Fluff,

Here is a variable "i" ??

Code:
Sub westernwall()
   Dim Cl As Range
   
   For Each Cl In Range("List")
      If Cl.Value <> "" Then
         Sheets.Add(, Sheets(Sheets.Count)).Name = Format(Range("List")([COLOR=#ff0000][B]i[/B][/COLOR]), "dd-mmmm")
      End If
   Next Cl
End Sub
 
Last edited:
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Good spot Tom
It should be
Code:
Sub westernwall()
   Dim Cl As Range
   
   For Each Cl In Range("List")
      If Cl.Value <> "" Then
         Sheets.Add(, Sheets(Sheets.Count)).Name = Format(Cl.Value, "dd-mmmm")
      End If
   Next Cl
End Sub
 
Upvote 0
Bang on! Many thanks Fluff and Tom.Jones. Glad combo, guys. Much appreciated.

West
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,189
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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