Forum Discussion
I would like to rename all the sheets from a list of names I have
- Jun 15, 2018
Hi Hursh,
You can do this by using a VBA code!
But you need to have these name listed in a worksheet stating from cell A1 as follows:
Then you can depend on this code to rename all worksheets at once:
Sub rename()
Dim r As Integer
r = 1
For Each Sheet In Sheets
Sheet.Name = Cells(r, 1).Value
r = r + 1
Next
End SubThis code will loop through each worksheet and rename the Sheet1 with the name of cell A1, Sheet2 with the name of cell A2, and so on.
Please check this https://www.ablebits.com/office-addins-blog/2013/12/06/add-run-vba-macro-excel/ to learn how to insert and run this code.
Regards
Hi Hursh,
You can do this by using a VBA code!
But you need to have these name listed in a worksheet stating from cell A1 as follows:
Then you can depend on this code to rename all worksheets at once:
Sub rename()
Dim r As Integer
r = 1
For Each Sheet In Sheets
Sheet.Name = Cells(r, 1).Value
r = r + 1
Next
End Sub
This code will loop through each worksheet and rename the Sheet1 with the name of cell A1, Sheet2 with the name of cell A2, and so on.
Please check this https://www.ablebits.com/office-addins-blog/2013/12/06/add-run-vba-macro-excel/ to learn how to insert and run this code.
Regards
This code worked for me perfectly.