Skip to main content

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


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)
'Updated by Extendoffice 20230130
    On Error Resume Next
    If Not Intersect(Target, Range("A1")) Is Nothing Then
        ActiveSheet.Name = ActiveSheet.Range("A1")
    ElseIf Not Intersect(Target.Dependents, Range("A1")) 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.


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.

Before applying Kutools for Excel, please download and install it firstly.

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.
4). 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.

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


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

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (30)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Good
It was the same thing I was looking for. But now I have a question:
After these steps were done, I created several sheets, I locked the sheet, but when I lock the book and enter a value in the cell, the name of the sheet does not change. In other words, it only changes with the spreadsheet unlocked and I would like to keep the spreadsheet locked
This comment was minimized by the moderator on the site
Boas
Era mesmo isto que estava a procurar. Mas agora tenho uma questão:
Após esses passos feitos, criei várias sheet, bloqueei a folha, mas quando bloqueio o livro e digito um valor na célula, o nome da sheet não muda. Ou seja, só muda com a sheet desbloqueada e gostaria de manter a sheet bloqueada
This comment was minimized by the moderator on the site
bonjour,
que voulez-vous dire par appuyer autre autre+q dans le code vba après avoir collé.
J'ai simplement fermé la page après avoir collé et ça ne marche pas
merci
This comment was minimized by the moderator on the site
worked beautifully!
This comment was minimized by the moderator on the site
Hi Crystal,

When i paste in your code it comes back with error "user-defined type not defined"?

Thanks.
This comment was minimized by the moderator on the site
Hi Tom J,
Make sure these three options are checked in the References - VBAProject dialog box.
https://www.extendoffice.com/images/stories/comments/comment-picture-zxm/error.png
This comment was minimized by the moderator on the site
This worked perfectly for my first worksheet, but not for the second or third etc (I have up to about 20 worksheets that all need this function). Am I missing something?
This comment was minimized by the moderator on the site
Hi A Owen,
This code only works for one worksheet per time. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
What is the highest nr of worksheets, that can be changed names via Kutools Plus? because the excel letting me only 17 names to changes, and that's it
This comment was minimized by the moderator on the site
I'm using your exact code from the above for VBA code which works perfectly for what I need. However, I have a bunch of macros on a sheet called Job Template that gets copied and reused for every new job. I designed all my macros based on a new copied version called Job Template (2). Once the sheet name is changed to the new job name, the macros no longer work and have to manually do it. I would like to be able to use any of my Macro buttons at any point instead of only using them before I change the sheet name.

Is there a way for the VBA code to always refer to the sheet name before running the rest of the code functions?
This comment was minimized by the moderator on the site
How can I reference two cells. for example name and id number?
This comment was minimized by the moderator on the site
This is exactly what I need, but I need the tab to recreate a date and it isn't working... I assume this is something to do with the way excel works out date and time, can anyone suggest a workaround?
This comment was minimized by the moderator on the site
Hi Nick,
Excel does not support typing the sheet name containing special characters. If the date you type contains the character /, it won't allow you to create the sheet name with that date.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations