sleecting text on text box

Ho do I select text on a text box in code.
If the user enters incorrect data I have setfocus to the text box but how do I highlight the text

Merlin007
merlin007Asked:
Who is Participating?
 
TimCotteeHead of Software ServicesCommented:
Use this:

With Text1
  .SelStart = 0
  .SelLength = Len(.Text)
End With


In the Text1_GotFocus event.
0
 
merlin007Author Commented:
Thanks Tim

Excellent help as usual

merlin007
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.