Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Highlight/Select contents of object with focus

Chip,

I thank God you knew the answer. Your solution finished
this project. Thank you for being willing to share your
expertise.

God bless you
-----Original Message-----
Andy,

Try something like the following:

Private Sub TextBox1_GotFocus()
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



"andy" wrote in message
...
I appoligize for the cross post from General, however no
one answered my post yesterday.

Some very nice people in this newsgroup gave me the code
to be able to tab, or sift/tab (move) between objects on
an Exel page.

Could someone tell me, once I have tabbed to the object
and it has the focus (e.g. textbox1.activate) how, if
there is text in the object, to hightlight/select all

the
text. This is the normal behaviour in MS apps. In this

way
the user can either tab through to the next, or return

to
the previous, and since the text is highlighted/selected
if the user starts typing, the original text is replaced
with what the user is typing, without the user haveing

to
either hightlight/select the original text with the

mouse,
or extra keystrokes.

Thank you in advance
God bless you



.

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
highlight select data Lindsay Excel Discussion (Misc queries) 1 June 4th 09 06:36 PM
why do 2 cells highlight when I only select 1? Montgomeryc Excel Discussion (Misc queries) 2 January 29th 09 06:45 PM
Excel - Selected Cell highlight on focus loss. Jack Excel Discussion (Misc queries) 0 August 11th 08 10:03 PM
Highlight Cell on Focus Nigel Graham Excel Programming 4 July 23rd 03 03:39 AM
Simulating the Format Painter, Selection.Select, and taking focus David McRitchie[_2_] Excel Programming 3 July 10th 03 03:48 AM


All times are GMT +1. The time now is 05:57 AM.

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

About Us

"It's about Microsoft Excel"