I have a combo box that I want to have a max lenght.
I found a way to do it with the code below.
I want the cursor to be at the end of the text after exiting the funciton.
This will put the cursor to before the first character.
If I add cmbText1.SetFocus at the end, it will highlight the text.
I just want the cursor to be at the end.
Private Sub cmbText1_Change()
tmpStr = cmbText1.Text
Debug.Print Mid(tmpStr, 1, 3)
If Len(cmbText1.Text) >= 4 Then
cmbText1.Text = Mid(tmpStr, 1, 3)