Highlighting Textbox1 Value when form initializes.

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

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,

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
 
thanx
Chip Pearson said:
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
 
Back
Top