Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 17
Default Select Text in Text Box

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Select Text in Text Box

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" wrote in message ...
Text1.SelLength = Len(Text1)

Sam wrote:

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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select text before carriage return jellyroller Excel Discussion (Misc queries) 3 April 26th 23 11:44 AM
Random select of text Tanya Excel Worksheet Functions 3 March 8th 08 02:50 PM
Manual select a text box Jared Excel Discussion (Misc queries) 3 November 27th 06 11:56 PM
Cannot select text boxes SMarie2834 Excel Discussion (Misc queries) 1 November 8th 06 08:18 PM
Text desappears when I select wrap text galse Excel Discussion (Misc queries) 4 June 2nd 06 09:28 PM


All times are GMT +1. The time now is 12:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"