Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to make sheet tab name equal to cell value in Excel?

In some cases, you may need to rename a worksheet based on a specified cell value. In this article, we will show you methods of making sheet tab name equal to cell value in Excel.

Make sheet tab name equal to cell value with VBA code

Make sheet tab name equal to cell value with Kutools for Excel


Easily create a sheet index by listing all sheet names in Excel:

Click Kutools Plus> Worksheet > Create List of Sheet Names to easily list all worksheet names in a new worksheet in Excel. And you can shift to corresponding worksheet directly with clicking on the sheet name.

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download the free trial Now!


arrow blue right bubble Make sheet tab name equal to cell value with VBA code


With the following VBA code, you can make sheet tab name equal to cell value automatically.

1. Right click the sheet tab which you want to make the sheet name equal to cell value, then click View Code from the right-clicking menu. See screenshot:

2. Copy and paste below code into the Code window, and then press Alt + Q keys simultaneously to close the Microsoft Visual Basic for Applications window.

VBA code: Make sheet tab equal to cell value

Private Sub Worksheet_Change(ByVal Target As Range)
	If Not Intersect(Target, Range("A1")) Is Nothing Then
		ActiveSheet.Name = ActiveSheet.Range("A1")
	End If
End Sub

Note: In the code, A1 is the cell which contains the value you need to use as sheet name. You can change it as you need.

From now on, when the value in cell A1 changed, the sheet tab name will be changed equally as well.


arrow blue right bubble Make sheet tab name equal to cell value with Kutools for Excel

In this section, we introduce you the Rename Multiple Worksheets utility of Kutools for Excel. With this utility, you can easily rename worksheets with certain cell’s value in Excel.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.

1. Click Kutools Plus > Worksheet > Rename Multiple Worksheets. See screenshot:

2. In the Rename Multiple Worksheets dialog box, you need to do as follows.

1). Check the worksheet names you want to rename in the Worksheets box (you can select one sheet or multiple sheets).

2). Select Replace original sheet name box in the Rename Options section.

3). If you want to rename a worksheet or multiple worksheets with specified cell’s value, please select the From specific range option, and select the range of cells that you want to rename the sheets based on.

3). Click the OK button. See screenshot:

You can see the selected worksheets are renamed by the specified range value immediately as below screenshot shown.

Notes:

1. You can use the Filter function to easily filter out the needed worksheet if there are lots of worksheets exist.

2. If you want to rename multiple worksheets with a certain cell value in each sheet. For example, sheet1 will be equal to its cell A1’s value, and sheet2 will also be equal to its cell A1’s value. Please select worksheets in the Worksheets box, then select the Rename worksheets with specific cell option, and specify cell A1 in the box.

3. The sheet name won’t be changed automatically with the cell value changes.


arrow blue right bubble Make sheet tab name equal to cell value with Kutools for Excel

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 60 days. Download the free trial now!


Recommended Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 71%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 82% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    Nilanjan Pal · 1 years ago
    You can rather use simple macro



    Sub Macro3()
    Dim index As Integer
    For index = 1 To 18

    Sheets(index).Name = Sheets(index).Range("A2").Value

    Next index



    End Sub
  • To post as a guest, your comment is unpublished.
    JAS · 1 years ago
    I got the whole code, and it worked. Thank you so much for your help!
  • To post as a guest, your comment is unpublished.
    jJJ · 1 years ago
    I am getting this code to work, but it does not automatically update the tab name when the cell it pulls the name from if referencing another cell (and that cell changes).


    I.e. I change a cell in a master list, which changes the cell text in a specific cell on each tab, which the code is referencing as the tab name, BUT the tab doesn't update its name correspondingly.
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Good day,
      The following VBA code can solve your problem. Thank you for your comment1

      Private Sub Worksheet_Change(ByVal Target As Range)
      Dim xRg As Range, xCell As Range
      On Error Resume Next
      If Not Intersect(Target, Range("A1")) Is Nothing Then
      ActiveSheet.Name = ActiveSheet.Range("A1")
      End If
      Application.EnableEvents = False
      Set xRg = ActiveSheet.Range("A1").Precedents
      If Not xRg Is Nothing Then
      For Each xCell In xRg
      ActiveSheet.Name = ActiveSheet.Range("A1")
      Next
      End If
      Application.EnableEvents = True
      End Sub
      • To post as a guest, your comment is unpublished.
        NOOR · 2 months ago
        I change a cell in a master list, which changes the cell text in a specific cell on each tab, which the code is referencing as the tab name, BUT the tab doesn't update its name correspondingly.

        ---- it's not work
      • To post as a guest, your comment is unpublished.
        John Hammonds · 3 months ago
        I need to use this code but I've never entered vba code before. Any guidance would be appreciated.
      • To post as a guest, your comment is unpublished.
        JAS · 1 years ago
        Still doesn't work. I'm having the same issue as jJJ. crystal: Is the whole code shown in your reply?
        The last line shown in your comment is "Set xRg = ActiveSheet.Range("A1").Precedents"
        • To post as a guest, your comment is unpublished.
          crystal · 1 years ago
          Dear JAS,
          Please click the Read more button on the right side of the comment to display the whole comment.
          • To post as a guest, your comment is unpublished.
            Alex · 1 years ago
            Still have the same issue.

            I have A1 of the new sheet point to another cell in a different tab. It updates the first time (when you execute) but then no change when editing the master cell
  • To post as a guest, your comment is unpublished.
    Jason · 1 years ago
    I pasted this in as instructed but it didn't show up in my list of available Macros. I tried to manually run it by keying in the Macro name. When it attempted to run the Macro, an error message came up "Argument no optional".

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A1")) Is Nothing Then
    ActiveSheet.Name = ActiveSheet.Range("A1")
    End If
    End Sub

    Has anyone else run this code and had the same issue?

    As a test I ran more basic code and it worked fine so the value in "A1" isn't causing the problem. When I run the code below I can see the Macro name "myTabName" in the Macro list. The code above doesn't appear and I'm assuming this is because of the bug/missing argument.

    Sub myTabName()
    ActiveSheet.Name = ActiveSheet.Range("A1")
    End Sub

    Thanks for your help as I'd very much like to use the code as intended for automating tab name changes based on a cell value..
    • To post as a guest, your comment is unpublished.
      crystal · 1 years ago
      Dear Jason,
      The code works well in my case. Would you please provide your Office version? Thank you for your comment.