The title mostly explains what I need. I have a textbox that I continuously examine for data validity using the _keypress
procedure. If the user enters (
then I auto-fill it for them by typing the closing parenthesis )
. The result is ()
and the cursor is at the end of the textbox.
My question is, how can I push the cursor back one step to put it between the two parenthesis? Thanks,
Edit: Test scenario:
Private Sub txtInput_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii = Asc("(") Then
txtInput.value = txtInput.value & "()"
KeyAscii = 0
End If
End Sub
Hope this makes it more clear,