0

Is there any control for UserForm that allows entering multiline text? If no, any advice how to get array of strings entered manually via UserForm?

The only way after 5 minutes of brainstorming is to use TextBox + 'Add' Button to add entered strings to ListBox and then read content of the ListBox control.

2 Answers 2

2

Use multiline property of the textbox. Set it to true. Then you can split the text with new line into array. See below

Dim stringArray as Variant
stringArray = Split(txtBox1.Text, vbCr) ' You may use vbLf or vbCrlf
Sign up to request clarification or add additional context in comments.

1 Comment

Maybe you could also mention changing the EnterKeyBehavior property. Otherwise multiline behaves counter-intuitively (at least to many people).
1

Use TextBox, go to properties, set multiline = true

enter image description here

Comments

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.