Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Userform Text Box

I have a text box on a user form. Depending on certain criteria different
statements show up in the text box. Sometimes the statement is longer than
will fit in the textbox. By default, when one clicks on the text box one can
arrow up or down or page up or down through the text and it scrolls. My
problem is, when one first clicks on the text box one is taken to the end of
the text by default. How can I get it to stay at the top of the text?


--
Thanks
Shawn
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Userform Text Box

Hi,

This worked for me.

Private Sub UserForm_Initialize()

TextBox1.SelStart = 0

End Sub

Cheers
Andy

Shawn wrote:
I have a text box on a user form. Depending on certain criteria different
statements show up in the text box. Sometimes the statement is longer than
will fit in the textbox. By default, when one clicks on the text box one can
arrow up or down or page up or down through the text and it scrolls. My
problem is, when one first clicks on the text box one is taken to the end of
the text by default. How can I get it to stay at the top of the text?



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Userform Text Box

Private Sub txtbxccexplaination_Enter()
CCFCLC.txbfcexplaination.SelStart = 0
End Sub

I used the above variation and it didn't work. It still went to the end of
the text.

--
Thanks
Shawn


"Andy Pope" wrote:

Hi,

This worked for me.

Private Sub UserForm_Initialize()

TextBox1.SelStart = 0

End Sub

Cheers
Andy

Shawn wrote:
I have a text box on a user form. Depending on certain criteria different
statements show up in the text box. Sometimes the statement is longer than
will fit in the textbox. By default, when one clicks on the text box one can
arrow up or down or page up or down through the text and it scrolls. My
problem is, when one first clicks on the text box one is taken to the end of
the text by default. How can I get it to stay at the top of the text?



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Userform Text Box

Why did you put the code in the Enter event instead of the
Userform_Initialize ?

Private Sub UserForm_Initialize()

Cheers
Andy

Shawn wrote:
Private Sub txtbxccexplaination_Enter()
CCFCLC.txbfcexplaination.SelStart = 0
End Sub

I used the above variation and it didn't work. It still went to the end of
the text.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 271
Default Userform Text Box

When the userform initializes the text on display in the text box is at the
begining. However, sometimes the text is longer than the text box. By
default, if you click on the text box you can page up and down through the
text. My problem is, that when someone clicks on the text box, it takes them
to the end of the text.
--
Thanks
Shawn


"Andy Pope" wrote:

Why did you put the code in the Enter event instead of the
Userform_Initialize ?

Private Sub UserForm_Initialize()

Cheers
Andy

Shawn wrote:
Private Sub txtbxccexplaination_Enter()
CCFCLC.txbfcexplaination.SelStart = 0
End Sub

I used the above variation and it didn't work. It still went to the end of
the text.


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info



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 certail text in a userform Text box sheeba Excel Programming 0 February 4th 06 10:58 AM
Text box in userform Tim Excel Programming 8 April 13th 04 10:28 PM
Text box on userform pcrobinson Excel Programming 3 January 8th 04 08:32 AM
Userform and Text Box Jamie[_6_] Excel Programming 5 December 16th 03 04:44 PM
Userform text box John Wilson Excel Programming 0 September 10th 03 07:31 PM


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