Programming tab order from field 1 to field 2 |
Technically, there are two forms controls in Microsoft EXCEL, ActiveX and not. In this post, I am referring to ActiveX. It is also possible to setup the latter but not without VBA codes, hence when it comes to forms controls in the spreadsheet, ActiveX controls offers more control.
So here it is, the codes that move the cursor from field 1 to field 2 in the example above when the user press tab while the cursor is in field 1.
Private Sub cb1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)Where cb1 is the name of field one.
If KeyCode = 9 Then cb2.Activate
End Sub