Avatar of FaheemAhmadGul
FaheemAhmadGul
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

VBA Code - How to tab from one TextBox to another so that after tabing the cursor is at the end of all the text in the next TextBox

On a VBA user Form I have two Text Boxes (named txtFirstName and txtLastName) and I frequently need to tab from one to another.

Currently when I tab from textbox to another all the text in the next Text Box gets selected. I would like to be able to tab to the next text box such that after pressing the tab key the cursor is at the of all the text in next TextBox.

I would appreciate help with how I set the properties of these Text Boxes so I achieve the above objective - that is after pressing the tab key when I get into the next textbox the cursor is at the end of all the text in the next text box.
If there is any VBA code which could enable such behaviour I would appreciate help with that also. Thanks.
I include an image to show what I am getting now and how I would like it to be.

Sample Image
VBAMicrosoft Excel

Avatar of undefined
Last Comment
Flyster

8/22/2022 - Mon