Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default send focus to a textbox

Hello all,
When my file opens I want it set the focus on a textbox that holds a user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at the
beginning of the verbiage that's written in it.
Any help?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 182
Default send focus to a textbox

Hi,
You can use this :

Private sub UserForm_Activate()\
Textbox1.setfocus
End Sub
--

Regards,

Halim


"TimT" wrote:

Hello all,
When my file opens I want it set the focus on a textbox that holds a user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at the
beginning of the verbiage that's written in it.
Any help?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default send focus to a textbox

Also, to place the cursor at the beginning of the 'verbiage'

TextBox1.SetFocus
TextBox1.SelStart = 0

Regards,
Peter T


"Halim" wrote in message
...
Hi,
You can use this :

Private sub UserForm_Activate()\
Textbox1.setfocus
End Sub
--

Regards,

Halim


"TimT" wrote:

Hello all,
When my file opens I want it set the focus on a textbox that holds a

user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at the
beginning of the verbiage that's written in it.
Any help?



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default send focus to a textbox

Thanks for your response.
You guys definitely understand what I trying to accomplish here.
I'm getting a Run-time error '424' Object required

I wasn't clear about all the facts I'm afraid.

The txtUserAgreement is embeded on sheet1 not a userform and sheet1 is
selected at the workbook open event.



"Peter T" wrote:

Also, to place the cursor at the beginning of the 'verbiage'

TextBox1.SetFocus
TextBox1.SelStart = 0

Regards,
Peter T


"Halim" wrote in message
...
Hi,
You can use this :

Private sub UserForm_Activate()\
Textbox1.setfocus
End Sub
--

Regards,

Halim


"TimT" wrote:

Hello all,
When my file opens I want it set the focus on a textbox that holds a

user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at the
beginning of the verbiage that's written in it.
Any help?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default send focus to a textbox

Okay...
It never fails.
I figured it out right after I replied.
I placed the code on the GotFocus of the txtUserAgreement.
Thanks guys!

"TimT" wrote:

Thanks for your response.
You guys definitely understand what I trying to accomplish here.
I'm getting a Run-time error '424' Object required

I wasn't clear about all the facts I'm afraid.

The txtUserAgreement is embeded on sheet1 not a userform and sheet1 is
selected at the workbook open event.



"Peter T" wrote:

Also, to place the cursor at the beginning of the 'verbiage'

TextBox1.SetFocus
TextBox1.SelStart = 0

Regards,
Peter T


"Halim" wrote in message
...
Hi,
You can use this :

Private sub UserForm_Activate()\
Textbox1.setfocus
End Sub
--

Regards,

Halim


"TimT" wrote:

Hello all,
When my file opens I want it set the focus on a textbox that holds a

user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at the
beginning of the verbiage that's written in it.
Any help?






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default send focus to a textbox

Sorry Tim, for a (Controls toolbox) Textbox on a worksheet you probably want
this pair

TextBox1.Activate
TextBox1.SelStart = 0

(substitute TextBox1 with your txtUserAgreement )

Code might go for example in the Worksheet activate event.

Regards,
Peter T


"TimT" wrote in message
...
Okay...
It never fails.
I figured it out right after I replied.
I placed the code on the GotFocus of the txtUserAgreement.
Thanks guys!

"TimT" wrote:

Thanks for your response.
You guys definitely understand what I trying to accomplish here.
I'm getting a Run-time error '424' Object required

I wasn't clear about all the facts I'm afraid.

The txtUserAgreement is embeded on sheet1 not a userform and sheet1 is
selected at the workbook open event.



"Peter T" wrote:

Also, to place the cursor at the beginning of the 'verbiage'

TextBox1.SetFocus
TextBox1.SelStart = 0

Regards,
Peter T


"Halim" wrote in message
...
Hi,
You can use this :

Private sub UserForm_Activate()\
Textbox1.setfocus
End Sub
--

Regards,

Halim


"TimT" wrote:

Hello all,
When my file opens I want it set the focus on a textbox that holds

a
user
agreement in it with scrollbars.
I want it to set the focus on the text box so that it starts at

the
beginning of the verbiage that's written in it.
Any help?






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
TextBox focus 4 Tim Coddington Excel Programming 6 August 4th 04 03:51 AM
TextBox focus 3 Tim Coddington Excel Programming 4 July 31st 04 04:35 AM
textbox focus Arne Excel Programming 1 June 15th 04 10:44 AM
TextBox Focus Tom Ogilvy Excel Programming 0 June 3rd 04 04:55 PM
TextBox focus Tom Ogilvy Excel Programming 0 June 3rd 04 03:17 PM


All times are GMT +1. The time now is 09:55 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"