0

I am trying to figure out how to display newly entered text from one userform text box to another userform text box in a new line below. Pretty much I want it to a multiline input. Here is the code I am using so far:

Private Sub CommandButton1_Click()
UserForm1.TextBox1.Value = TextBox1.Value & vbNewLine
End Sub

image of what I am trying to accomplish

1 Answer 1

2

Try this

Private Sub CommandButton1_Click()
    UserForm1.TextBox1.Value = UserForm1.TextBox1.Value & vbNewLine & UserForm2.TextBox1.Value
End Sub
Sign up to request clarification or add additional context in comments.

4 Comments

you should mark his answer as the proper answer to you question now ;)
@PaichengWu Sorry to reopen this question, is there any way of making the text start a multi line after the first input has been submitted? You can see in my above screenshot that Sample Text 1 is all the way in the top, in your provided code "Sample Text 1" skips a line. Thanks again for all your help
You can try to remove vbNewLIne and one & for my code.
@PaichengWu, I think it should be added, that the MultiLine property of the corresponding TextBoX object must be set to True. I have forgotten this on my first try and wondered why this solution did not work. This is just an improvement of the given solution, which is right.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.