PDA

View Full Version : VBA reading multiline textbox line by line



Ventilaator
08-31-2011, 11:20 AM
Hello,

How to read multiline textbox into a string array line by line. No wordwrap is allowed in the textbox.

I tried using split function with vbcrlf without any luck.

Thanks in advance,
-Vent

Kenneth Hobs
08-31-2011, 12:26 PM
Why do it line by line? Split worked for me.
Sub t()
Dim a() As String
a = Split(Sheet1.TextBox1.Text, vbCrLf)
MsgBox Join(a, vbLf)
End Sub