Excel Macro: Rename all Worksheets [Solved/Closed]

Report
-
 ansvk1 -
So, I'm trying to figure out a way to rename all the worksheets in a workbook.

the first worksheet would be "1" (without the quotation marks) and continue up for each worksheet, so the second worksheet would be 2, the third worksheet 3, etc.

any help will be much appreciated.
thanks

2 replies

Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
756
Sub renameSheets()
Dim iSheetCount

    For iSheetCount = 1 To Sheets.Count
        Sheets(iSheetCount).Name = iSheetCount
    Next iSheetCount

End Sub
15
Thank you

A few words of thanks would be greatly appreciated. Add comment

CCM 5378 users have said thank you to us this month

Thanks a bunch!
Many many thanks to you, good job, it was very helpful to me. Thank you again. :)
awesome!
great! can you tell me how to have this new name in the formate of FiscalWeek 1,2,3,4...so on till FW32?
Sub renameSheets()
' Selected Sheets doing Rename
' No of Sheets
' Enter rename of sheets

Dim a, b As Integer
a = MsgBox("Do you want rename sheets", vbOKCancel, "RENAME SHEETS")
If a = vbOK Then
b = InputBox("How many sheets are rename?", "RENAME SHEETS")
For I = 1 To b
Sheets(i).Select
a = InputBox("Enter name to be change in sheets" & (i), "Rename Sheets")
Sheets(i).Name = a
MsgBox "Rename Sheet" & (i), vbInformation, "RENAME SHEETS"
Next i
MsgBox "Sheets are renamed", vbInformation, "RENAME SHEETS"
Else
MsgBox "I won't rename sheets", vbOKCancel, "RENAME SHEETS"
End If
End Sub