Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

tabs

ResolvedVersion 2013

Shadé has attended:
Excel Intermediate course

Tabs

Is it possible when adding new tab where there are already tabs numbered in a sequence for the tbs to adapt to the new number that is added. So if I added a tab in between tabs labelled 1 and 2 and named the new tab 2 is there a way to automatically relabel all the following tabs instead of going in and having to manually change every tab.

RE: Tabs

Hi Shadé,

Thank you for the forum question.


You can achieve this in Excel using a bit of VBA (Visual Basic for Applications) scripting. Here’s a simple script that will automatically renumber your tabs when you insert a new one:

Press Alt + F11 to open the VBA editor.
Insert a new module by clicking Insert > Module.
Copy and paste the following code into the module:
Sub RenumberTabs()
Dim ws As Worksheet
Dim i As Integer
i = 1
For Each ws In ThisWorkbook.Worksheets
ws.Name = i
i = i + 1
Next ws
End Sub

Close the VBA editor.
Run the script by pressing Alt + F8, selecting RenumberTabs, and clicking Run.
This script will go through all the worksheets in your workbook and rename them sequentially starting from 1. If you insert a new tab and run the script again, it will automatically adjust the numbering.





Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

Mon 28 Oct 2024: Automatically marked as resolved.

 

Training courses

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

How to Spell Check an Excel 2010 Worksheet

Excel 2010 does not automatically spell check a document. So, here's how to manually spell check a worksheet.

Either select the ''Review'' tab in the Ribbon, go to the ''Proofing'' section and click ''Spelling.'' Or, simply press F7.

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.