Easy String Question

How do I add a return (next line) to a string"

Eg:
"Text1" (string)
"Text2" (string)
Combine some how, and get
"Text1
Text2"
aomegaAsked:
Who is Participating?
 
mfclaesConnect With a Mentor Commented:
Hi,

I don't know if this is what you want

just open a new project, add a form and a textbox named text, and past the following code


Private Sub Form_Load()
    Dim Text1 As String
    Dim Text2 As String
    Dim result As String
    Text1 = "first line"
    Text2 = "second line"
    result = Text1 & vbCrLf & Text2
    Text.Text = result
End Sub

regards

0
 
hatem72Commented:
MsgBox "Text1" + Chr(10) + "Text2"
0
 
aomegaAuthor Commented:
Sorry, I'm planning to send it to RTB so that won't work.

Text1 & vbCrLf & Text2
might work,, so I'm trying it now.
0
 
aomegaAuthor Commented:
Oh, he got it too...
Well it works, thanks.
0
 
hatem72Commented:
Sory what the RTB ???
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.