• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

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"
0
aomega
Asked:
aomega
  • 2
  • 2
1 Solution
 
hatem72Commented:
MsgBox "Text1" + Chr(10) + "Text2"
0
 
mfclaesCommented:
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
 
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now