ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Highlighting Textbox1 Value when form initializes. (https://www.excelbanter.com/excel-programming/283706-highlighting-textbox1-value-when-form-initializes.html)

Todd Huttenstine[_3_]

Highlighting Textbox1 Value when form initializes.
 
I have a userform and would like on userform initialization to highlight the
text in textbox1. What would the code be for this?


Thanx

Todd Huttenstine




Chip Pearson[_2_]

Highlighting Textbox1 Value when form initializes.
 
Todd,

Use code like the following:

Private Sub UserForm_Initialize()
With Me.TextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Todd Huttenstine" wrote in message
...
I have a userform and would like on userform initialization to highlight

the
text in textbox1. What would the code be for this?


Thanx

Todd Huttenstine






Todd Huttenstine[_3_]

Highlighting Textbox1 Value when form initializes.
 
thanx
"Chip Pearson" wrote in message
...
Todd,

Use code like the following:

Private Sub UserForm_Initialize()
With Me.TextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Todd Huttenstine" wrote in message
...
I have a userform and would like on userform initialization to highlight

the
text in textbox1. What would the code be for this?


Thanx

Todd Huttenstine









All times are GMT +1. The time now is 09:07 PM.

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