0

I want to enter each element of an array onto a new line in multiline textbox on a userform. I have the Multiline and EnterKeyBehaviour of the textbox set to True.

The code below will enter the array elements but after entered they are then overwritten by the next element.

For i = LBound(clipArray) To UBound(clipArray)
        frmMyForm.txtBox.Text = clipArray(i)
Next

I have tried variations like below (with vbCr, vbCrLf etc) but still does not work.

frmMyForm.txtBox.Text = clipArray(i, vbNewLine)

How can I fix?

1 Answer 1

1

Please, use:

   frmMyForm.txtBox.Text = Join(clipArray, vbLf)
Sign up to request clarification or add additional context in comments.

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.