Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default TextBox.Activate - QUICKY OFF THE TOP OF SOMEONES HEAD

When I use TxtName.Activate (where TxtName is a textbox with some
narrative already in it) I'd like all the text to be selected, rather
than the cursor just ending up at the end of the narrative.

Any help greatly appreciated

Jason
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default TextBox.Activate - QUICKY OFF THE TOP OF SOMEONES HEAD

Jason,

Use the SelStart and SelLength properties. E.g,

With Me.TextBox1
.SelStart =0
.SelLength = Len(.Text)
.SetFocus
End With

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jason" wrote in message
om...
When I use TxtName.Activate (where TxtName is a textbox with

some
narrative already in it) I'd like all the text to be selected,

rather
than the cursor just ending up at the end of the narrative.

Any help greatly appreciated

Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default TextBox.Activate - QUICKY OFF THE TOP OF SOMEONES HEAD

Hi Jason,

TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *


"jason" wrote in message
om...
When I use TxtName.Activate (where TxtName is a textbox with some
narrative already in it) I'd like all the text to be selected, rather
than the cursor just ending up at the end of the narrative.

Any help greatly appreciated

Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default TextBox.Activate - QUICKY OFF THE TOP OF SOMEONES HEAD

THANKS FOLKS - KNEW IT WOULD BE A QUICK ONE FOR SOMEONE

JASON

"Chip Pearson" wrote in message ...
Jason,

Use the SelStart and SelLength properties. E.g,

With Me.TextBox1
.SelStart =0
.SelLength = Len(.Text)
.SetFocus
End With

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"jason" wrote in message
om...
When I use TxtName.Activate (where TxtName is a textbox with

some
narrative already in it) I'd like all the text to be selected,

rather
than the cursor just ending up at the end of the narrative.

Any help greatly appreciated

Jason

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
Head to head Noob Jedi Excel Discussion (Misc queries) 3 August 31st 07 11:26 PM
Testing someones skillz... ChuckF Excel Worksheet Functions 7 August 31st 06 11:45 PM
How do I write the formula to calculate someones time worked deusy Excel Worksheet Functions 3 November 16th 05 08:49 PM
How do I find someones age in whole numbers? BrianHall222 Excel Discussion (Misc queries) 5 September 8th 05 07:14 PM
using 'enter' on a textbox to activate a command button? neowok[_23_] Excel Programming 1 February 25th 04 12:25 PM


All times are GMT +1. The time now is 02:20 PM.

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"