Rename Workheet Names in File

WESTERNWALL

Board Regular
Joined
Oct 8, 2002
Messages
193
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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,056
Messages
6,122,907
Members
449,096
Latest member
dbomb1414

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