Forum Discussion

Shanmukhvarun's avatar
Shanmukhvarun
Copper Contributor
Nov 12, 2021

Rename Sheet

Hello

 

Can we rename multiple sheets in the single click? If Supose I have list in A1 in Sheet 1 and the list each name should be named as the each sheet. Is that possible? Please advise. 

4 Replies

  • Shanmukhvarun 

    What exactly do you mean by "I have list in A1 in Sheet 1"?

    Do you have multiple names in cell A1? Or did you mean a list in A1, A2, A3 etc.?

    • Shanmukhvarun's avatar
      Shanmukhvarun
      Copper Contributor

      HansVogelaar I have Multiple names in like mentioned in the screenshot and the sheets have already data in that so when I use any code the existing sheet names should change to the names that I provided

       

       

       

      • HansVogelaar's avatar
        HansVogelaar
        MVP

        Shanmukhvarun 

        Your list starts in A2, not in A1...

        Here is a macro you can run. Please test on a copy of your workbook.

         

        Sub RenameSheets()
            Dim i As Long
            On Error Resume Next
            i = 2
            Do
                Sheets(i - 1).Name = Sheets(1).Range("A" & i).Value
                i = i + 1
            Loop Until Sheets(1).Range("A" & i).Value = ""
        End Sub

         

Resources