tabs

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

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Tabs

Tabs

resolvedResolved · High Priority · Version 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

 

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 select certain data in an Excel 2010 workbook

If you want to select the correct data set in a page full of data, the most accurate and efficient way of doing this is to use the ''Shift and Click'' technique.

For example: If you want to select all data in cells A2 to E10, then click on cell A2, hold down the Shift key and click on cell E10 and all the data you want to see is highlighted.

Keep holding down the Shift key and you can move from cell E10 to any other cell in the spreadsheet.

View all Excel hints and tips


Server loaded in 0.1 secs.