Results 1 to 4 of 4

Thread: [RESOLVED]Join 2 lines of string, but start the 2nd on a new line...

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    14

    Resolved [RESOLVED]Join 2 lines of string, but start the 2nd on a new line...

    I want to join 2 lines of string and then have the 2nd one start on a new line.
    ex.
    Text1 = Line1
    Text2 = Line2
    Text1 + Text2 = Line1Line2

    i want to make it

    Text1 + Text2 = Line1
    Line2
    Last edited by timbowman1; Sep 12th, 2010 at 07:39 PM.

  2. #2
    PowerPoster Code Doc's Avatar
    Join Date
    Mar 2007
    Location
    Omaha, Nebraska
    Posts
    2,354

    Re: [RESOLVED]Join 2 lines of string, but start the 2nd on a new line...

    Interesting. Resolved with 0 replies. So, how did you solve it on your own?
    Doctor Ed

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2010
    Posts
    14

    Re: [RESOLVED]Join 2 lines of string, but start the 2nd on a new line...

    I just kept trying different things.. i had to add vbCrLf & _ before the new line

    I have another question, though

  4. #4
    Next Of Kin baja_yu's Avatar
    Join Date
    Aug 2002
    Location
    /dev/root
    Posts
    5,989

    Re: [RESOLVED]Join 2 lines of string, but start the 2nd on a new line...

    Use & when doing string concatenation instead of +

    String concatenation will just join the two strings, that's why you get "Line1Line2", if you want something in the middle, you have to code for it. For example

    Text1.Text & " " & Text2.Text >>> will give you "Line1 Line2"

    You can similarly insert a vbNewLine character in between to get the result you wanted.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width