Highlighting text in a textbox

  • Thread starter Thread starter Daniel Bonallack
  • Start date Start date
D

Daniel Bonallack

Could someone please tell me how to highlight the text in
a textbox on a form?

My textbox has just the number 1 in it, and when the form
is initialized, I'd like the focus on that textbox, with
the number 1 highlighted.

Thank you very much

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

-Brad
 
Back
Top