Here is the updated VBA code to set the ( TabIndex ) & ( TabStop ) just prior to
a UserForm being loaded in
Anyway a concept I now do on most UserForms, is to place all objects( TextBoxes
and Optionbuttons ) sequentially in numbered order inside a Frame
With this concept I can do the ( TabStop=FALSE ) on a Frame, so the none of the
objects inside the specfic frame aren't tabbed to
For example, in another Userform I have optionbuttons inside a frame I didn't
want to be tabbed to with the ( TabKey )
Then with the code below, most Userforms comes out perfect with the ( TabKey )
sequence in sequential order.
Application.ScreenUpdating = False
tabIdx = 0
Set myForm = UserForm10
For Each cCont In myForm.Controls
tabIdx = tabIdx + 1
'MsgBox ("TYPENAME: " & TypeName(cCont))
Select Case TypeName(cCont)
Case "Frame"
cCont.TabStop = True
cCont.TabIndex = tabIdx
Case "CommandButton"
cCont.TabStop = False
Case "OptionButton"
cCont.Value = False
cCont.TabStop = True
cCont.TabIndex = tabIdx
Case "ComboBox"
cCont.TabStop = False
Case "TextBox"
cCont.TabStop = True
cCont.TabIndex = tabIdx
Case "Label"
'nothing here
End Select
Next cCont
'UserForm10.Show