Selecting part text in a textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi I have been trying to select a part of a text entry into a textbox, I
tried to use selstart etc I can remove the text but not hightlight it can
someone show me how this can be done.
TIA
Charles
 
Hi Charles

With TextBox1
.Text = "Harald says cool, man"
.SelStart = 12
.SelLength = 4
End With

HTH. best wishes Harald
 
I tried to doing it like this but I still can get it to select the text, if
the user enters let say more than 5 digits I want to highlight the extra
digits to give the user a chance to view or delete it.
Regards
Charles
 
Did my code not work ?
Exactly when and how do you want this to happen, are you calling the code
from an event ? Which event ?
Do you have some annoying messagebox prior to this action ? Don't.
Seeing your code would help me help you.

Best wishes Harald
 
Harald I do have a message explaining that the user has entered more or less
than 5 digits but I also wanted to highlight the part that is extra.
Charles
 
Sure, go a head, highlight the extra parts. My code sample showed you how to
do it.

Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Highlight Text In A Textbox 3
textbox insertion point. 1
Highlight Value of Text Box 1
Lock colon in textbox 1
TextBox Text 3
Select Text in TextBox 4
Combobox selection 1
Textbox form to Textbox in worksheet 4

Back
Top