![]() |
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 |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 02:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com