Select Text in Text Box

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

Guest

Hello,

I have a user form that when it opens, I want the default text in it to be selected. I can't figure out how to do this. I've tried setting the relevant properties and used the Setfocus method, but I can't get it to work. Is this possible?

Any help would be appreciated!

Sam
 
Sam,

You need SelStart as well

With TextBox1
.Text = "This is a test"
.SelStart = 0
.SelLength = Len(.Text)
.SetFocus
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Thomas said:
Text1.SelLength = Len(Text1)
be selected. I can't figure out how to do this. I've tried setting the
relevant properties and used the Setfocus method, but I can't get it to
work. Is this possible?
 
Back
Top