Expandable Text Boxes

travis15

New Member
Joined
Jun 8, 2004
Messages
9
I would like to add a text box that expands if the user types more information into the box than the text area originally permitted. Making all the text viewable without scrolling. I need spell check to work on this box also. Can anyone help me with this?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hello and welcome to the board.

To expand the text box, if you right click the mouse when over the mose and select properties, one of the properties is AutoSize, change this to True.

As for the spell check, no ideas yet.
 
Upvote 0
Hello,

Sort of, you could set the MaxLength, this will only allow a certain number of characters.

But this isn't quite what you want is it?

What about this code?

Code:
Private Sub TextBox1_Change()
If TextBox1.Width > 50 Then
    TextBox1.Height = TextBox1.Height + 20
    TextBox1.WordWrap = True
    TextBox1.Width = 50
    TextBox1.MultiLine = -True
End If
End Sub

Is this any better?
 
Upvote 0
Hello,

Place the mouse over the text box, and press the right hand mouse button, Select View Code, you will have a window appear showing this

Code:
Private Sub TextBox1_Change()

End Sub

Delete this and paste the supplied code here.

OK?
 
Upvote 0
Ok. I was using the drawing textbox. And the right click does not give the option of viewing the code. It was there when I used the control toolbox. This is not exactly want I want. I don't think I was very clear, sorry.

I am tring to crate a form that will be a series of feilds were text will be entered. I want to control the width, but I want the height to expand to fit the text. So when one box expands the whole form will have to expand so that the seond box will not be covered up by the first.

Was that a better explanation?
 
Upvote 0

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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