Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA - Excel TabIndex?

Status
Not open for further replies.

Funkymatt

Programmer
Aug 27, 2002
101
0
0
US
I have two text boxes and I want to tab between them in Excel. Sheet1.TextBoxGrp.TabIndex does not exist as a method? How can I accomplish this?
 
If you have a TextBox1 and TextBox2 the following code will Tab from TextBox1 to TextBox2 :
Code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
                             ByVal Shift As Integer)
    If KeyCode = 9 Then TextBox2.Activate
End Sub
You can repeat the same idea for the second TextBox. Right click on the sheet with the TextBoxes, select View Code and enter the code in the resultant code pane.

A.C.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top