Forum Discussion

Hursh Patel's avatar
Hursh Patel
Copper Contributor
Jun 15, 2018
Solved

I would like to rename all the sheets from a list of names I have

I have 112 sheets and 112 names, I would like to rename all of the sheets. How can I do this?
  • Haytham Amairah's avatar
    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 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 link to learn how to insert and run this code.

     

    Regards

Resources