Userform Text Box

S

Shawn

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?
 
A

Andy Pope

Hi,

This worked for me.

Private Sub UserForm_Initialize()

TextBox1.SelStart = 0

End Sub

Cheers
Andy
 
S

Shawn

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.
 
A

Andy Pope

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

Private Sub UserForm_Initialize()

Cheers
Andy
 
S

Shawn

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top