try something like:
VB Code:
Private Sub TextBox1_Change() If TextBox2 = validinput Then TextBox2.Select Else MsgBox "Enter valid input", vbOKOnly + vbCritical, "Input Error" End If End Sub
you can remove the validation part of the above.
[EDIT]
the above doesnt work as it works after each character input so try the below:
VB Code:
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) 'sets focus to next text object when ENTER is pressed 'KeyCode = 9 can be used for TAB key If KeyCode = 13 Then TextBox2.Select End If End Sub
also, the things you are looking to do will work on a UserForm, as tab order and SetFocus can both be utilised.
is a User form an option for you?




Reply With Quote