Highlight/Select text in User Form?

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

Guest

I have created a User Form for data entry, some of the boxes in which contain
text, as a guide of what to enter. Is there a way, when the user tabs to
these boxes, to highlight/select the text so it is overwritten when they
type, as opposed to the them manually selecting and deleting the text before
entering?

I'm sure I saw something somewhere, but I can't find it now when I need it
(typical!). Thanks,

Alan
 
Private Sub TextBox1_Enter()
With Me.TextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Thanks Bob, that worked a treat!

Bob Phillips said:
Private Sub TextBox1_Enter()
With Me.TextBox1
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With
End Sub


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Back
Top