Name

control.TabIndex [= setting]

Synopsis

Sets or returns the position of the control in the tab order. Must be a positive whole number. The following code makes TextBox1 the first control in the tab order and gives that control focus when the form is first displayed:

    Private Sub UserForm_Initialize(  )
        TextBox1.TabIndex = 0
    End Sub

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.