Can I change the default sheet name?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to change the default worksheet name of Sheet1 to 0001 to
continue 0002, 0003 and so forth. Is there an option where I can change that
name?
 
Thanks - I should've worded my question differently. I can rename one sheet
at a time, but I have 100 sheets that I need to name 0001, 0002, 0003...
0100. I changed the default amount of sheets to 100, but I would like for
the sheets to automatically be named 0001, 0002, etc.

Thanks again,
Amanda
 
One way:

Run this macro to change the name of the 100 sheets. Delete the macro if
desired, then save the workbook as a template.


Public Sub RenameWorksheets()
Dim i As Long
For i = 1 to Worksheets.Count
Worksheets(i).Name = Format(i, "0000")
Next i
End Sub

You can make this the default template by saving the template as
"Book.xlt" in your XLStart folder.
 
Thank you so much - that worked beautifully!!

JE McGimpsey said:
One way:

Run this macro to change the name of the 100 sheets. Delete the macro if
desired, then save the workbook as a template.


Public Sub RenameWorksheets()
Dim i As Long
For i = 1 to Worksheets.Count
Worksheets(i).Name = Format(i, "0000")
Next i
End Sub

You can make this the default template by saving the template as
"Book.xlt" in your XLStart folder.
 
Can I also use this type of Macro to name the sheets January, February,
March, etc? I'm not familiar with macros.
 
One way:

Public Sub RenameWorksheets()
Dim i As Long
For i = 1 To Worksheets.Count
Worksheets(i).Name = Format(DateSerial(0, i, 1), "mmmm")
Next i
End Sub

Note that this will only work for 12 sheets or less, since sheets can't
have the same name as another sheet.
 
Thanks again for being so helpful!!

JE McGimpsey said:
One way:

Public Sub RenameWorksheets()
Dim i As Long
For i = 1 To Worksheets.Count
Worksheets(i).Name = Format(DateSerial(0, i, 1), "mmmm")
Next i
End Sub

Note that this will only work for 12 sheets or less, since sheets can't
have the same name as another sheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top