In order to highlight text in a TextBox (other than Tabbing into that field), you can insert a couple helpful snippets of VBA  code that will help you accomplish this easily!

The first line tells VBA to put the cursor at the leftmost (0) character:

Me.TextBox1.SelStart = 0

The next line tells it to select the length of whatever the length of characters you have in that textbox:

Me.TextBox1.SelLength = Len(Me.TextBox1)


Pretty simple, right!?

Check out this video to see more details, including how to apply this to a button or even when the userform opens!


Forgot Password?

Join Us