ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select text in textbox (https://www.excelbanter.com/excel-programming/319116-select-text-textbox.html)

Todd huttenstine

Select text in textbox
 
Hey guys

I have done this in the past but I forgot. After I set
focus to textbox1, I need it to highlight all the text in
textbox1.

How do I do this?

Thanks
Todd Huttenstine

Tom Ogilvy

Select text in textbox
 
Private Sub CommandButton1_Click()
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.SelLength = Len(TextBox2.Value)

End Sub

--
Regards,
Tom Ogilvy


"Todd Huttenstine" wrote in message
...
Hey guys

I have done this in the past but I forgot. After I set
focus to textbox1, I need it to highlight all the text in
textbox1.

How do I do this?

Thanks
Todd Huttenstine




todd

Select text in textbox
 
thanks
-----Original Message-----
Private Sub CommandButton1_Click()
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.SelLength = Len(TextBox2.Value)

End Sub

--
Regards,
Tom Ogilvy


"Todd Huttenstine"

wrote in message
...
Hey guys

I have done this in the past but I forgot. After I set
focus to textbox1, I need it to highlight all the text

in
textbox1.

How do I do this?

Thanks
Todd Huttenstine



.



All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com