To achieve the effect of creating new lines of text, "paragraph-looking" text, etc. in a TextBox when you hit Enter while entering text into a TextBox, set the TextBox's EnterKeyBehavior property to True *AND* set its MultiLine property to True.
A comment can hold about 32,000 characters of text, or about 255 lines.
You can enter the TextBox text into a cell like so:
Private Sub CommandButton1_Click()
Range("A1").Value = TextBox1.Text
End Sub
You can append an existing cell value with an added text like so:
Private Sub CommandButton2_Click()
Range("A1").Value = Range("A1").Value & TextBox1.Text
End Sub
You can populate a userform's TextBox with a cell's value like so:
Private Sub UserForm_Initialize()
TextBox1.Text = Range("A1").Value
End Sub
In the worksheet cell, you will see little squares that represent where the user hit the Enter key in the userform TextBox. Those are most likely ascii character 13 and normal given what you are asking for.


LinkBack URL
About LinkBacks



Reply With Quote

Bookmarks