Display form text box contents at top not bottom

tx12345

Board Regular
Joined
Aug 28, 2006
Messages
165
Hi

i know this is probably going to be the world's dumbest question. i have a fairly hefty form text box. for some reason it always opens at the bottom. Or, if the scroll bar is not highlighted and then one clicks into the text box, the scroll bar appears and the cursor goes right to the bottom.

basically the question is this:

how do you set up a form text box that has a few thousand words to 1) always show a scroll and 2) how do get it so when one clicks into it the cursor shows at the top and not the bottom?

i've have tinkered with the EnterFieldBehavior but cant get it to work

as always, many thanks

tx
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Create a userform with TextBox1 to run this example...

<table width="100%" border="1" bgcolor="White" style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"><tr><TD><font size="2" face=Courier New>  <font color="#0000A0">Private</font> <font color="#0000A0">Sub</font> UserForm_Click()
       <font color="#0000A0">Dim</font> a, b, c

       TextBox1.MultiLine = <font color="#0000A0">True</font>
       TextBox1.WordWrap = <font color="#0000A0">True</font>

       c = "W"
       <font color="#0000A0">For</font> a = 1 <font color="#0000A0">To</font> 1000
           b = b & c
       <font color="#0000A0">Next</font>

       TextBox1 = b
       TextBox1.SelStart = 0
       TextBox1.ScrollBars = fmScrollBarsVertical
  <font color="#0000A0">End</font> <font color="#0000A0">Sub</font>
</FONT></td></tr></table><button onclick='document.all("107200621524421").value=document.all("107200621524421").value.replace(/<br \/>\s\s/g,"");document.all("107200621524421").value=document.all("107200621524421").value.replace(/<br \/>/g,"");window.clipboardData.setData("Text",document.all("107200621524421").value);'>Copy to Clipboard</BUTTON><textarea style="position:absolute;visibility:hidden" name="107200621524421" wrap="virtual">
Private Sub UserForm_Click()
Dim a, b, c

TextBox1.MultiLine = True
TextBox1.WordWrap = True

c = "W"
For a = 1 To 1000
b = b & c
Next

TextBox1 = b
TextBox1.SelStart = 0
TextBox1.ScrollBars = fmScrollBarsVertical
End Sub</textarea>
 
Upvote 0

Forum statistics

Threads
1,215,152
Messages
6,123,323
Members
449,094
Latest member
Chestertim

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top