Download the Practice Workbook
You can download the practice workbook from here.
4 Easy Methods to Change Tabbing Order in Excel
We have created a simple and concise user form. It has 4 text boxes namely Customer ID, First Name, Last Name, and Email. We will see show how to navigate between these text boxes by setting a custom tab order.
Method 1 – Changing the Tabbing Order from View Tab in VBA Window
Steps:
- In the VBA window, click on View.
- Select Tab Order.
- This will open the Tab Order window where you will see all the text boxes.
- Click on the Move Up or Move Down buttons to set the tabbing order.
- Click OK once you are done.
Method 2 – Set the Tabbing Order from the UserForm
Steps:
- Right-click on the UserForm that you are currently working with.
- Select Tab Order.
- You should see the Tab Order window as previously and can change the order from there.
Read More: How to Create Excel VBA UserForm (with Detailed Steps)
Method 3 – Manually Inserting a TabIndex
Steps:
- Click on any of the text boxes.
- Navigate to the Properties window and click on TabIndex.
- Enter the TabIndex of the first text box as 0.
- Enter 1 for the next text box in the sequence, 2 for the next one, and so on.
- This will set the tab order for the text boxes.
Similar Readings
- How Different Is VBA from Other Programming Languages
- Learn Excel VBA Programming & Macros (Free Tutorial – Step by Step)
- 22 Macro Examples in Excel VBA
- How to Use Excel VBA Userform (2 Suitable Examples)
Method 4 – Using Ctrl and Left Mouse Button
Steps:
- Press and hold Ctrl, then click on the text boxes in the order that you want to tab.
- Go to the Properties window and type 0 in TabIndex.
- This should set the tab order that you selected.
How to Set a Tab Order in Protected Excel Sheet
Steps:
- Right-click on the tab of the protected sheet and click on View Code.
- Insert the following code in the new VBA window with the name of the sheet.
- When you insert data in the selected cells and press the tab key, this will follow the cell sequence that you set in the code.
Private Sub Set_Order_Protected_Sheet(ByVal trgt As Range)
Dim tabArr As Variant
Dim n As Long
tabArr = Array("B5", "C6", "D7", "E8")
Application.ScreenUpdating = False
For n = LBound(tabArr) To UBound(tabArr)
If tabArr(n) = trgt.Address(0, 0) Then
If n = UBound(tabArr) Then
Me.Range(tabArr(LBound(tabArr))).Select
Else
Me.Range(tabArr(n + 1)).Select
End If
End If
Next n
Application.ScreenUpdating = True
End Sub
Related Articles
- 20 Practical Coding Tips to Master Excel VBA
- How to Write VBA Code in Excel (With Easy Steps)
- Types of VBA Macros in Excel (A Quick Guide)
- What You Can Do with VBA (6 Practical Uses)
- Introduction to VBA Features and Applications
- 6 Best Excel VBA Programming Books (For Beginners & Advanced Users)