+ Reply to Thread
Results 1 to 4 of 4

Having trouble with "vbcr"

  1. #1
    Registered User
    Join Date
    01-05-2006
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    38

    Having trouble with "vbcr"

    When I use "vbcr" in trying to display text in text boxes and cells, Instead of my text being moved to the next line, the carriage return symbol is printed and I have only one continous line. Here is sample code of what I tried:

    msg = worksheets("sheet1").range("a3")
    worksheets("sheet2").range("c7") = msg + vbcr + "Balance sheet"

    I'm attempting to move whats in "a3 sheet1" to "c7 sheet2" and add a line under that says "balance sheet"

    Please help

    Thanks
    Terry

  2. #2
    Chip Pearson
    Guest

    Re: Having trouble with "vbcr"

    Use vbLf instead of vbCr.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "terrysoper1973"
    <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > When I use "vbcr" in trying to display text in text boxes and
    > cells,
    > Instead of my text being moved to the next line, the carriage
    > return
    > symbol is printed and I have only one continous line. Here is
    > sample
    > code of what I tried:
    >
    > msg = worksheets("sheet1").range("a3")
    > worksheets("sheet2").range("c7") = msg + vbcr + "Balance sheet"
    >
    > I'm attempting to move whats in "a3 sheet1" to "c7 sheet2" and
    > add a
    > line under that says "balance sheet"
    >
    > Please help
    >
    > Thanks
    > Terry
    >
    >
    > --
    > terrysoper1973
    > ------------------------------------------------------------------------
    > terrysoper1973's Profile:
    > http://www.excelforum.com/member.php...o&userid=30161
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=498434
    >




  3. #3
    Registered User
    Join Date
    01-05-2006
    Location
    Toronto, Ontario
    MS-Off Ver
    2007
    Posts
    38
    Previous post was solved with vblf instead of vbcr, but won't work with textboxes

    'works with cells but not with text boxes
    msg = worksheets("sheet1").range("a3")
    worksheets("sheet2").range("c7") = msg + vblf + "Balance sheet"

    If I want to do the same thing, but using a textbox for the destination, how is it done.

    'displays vbcr or vblf code
    Private Sub cb1_Click()
    msg = Range("b2") + vbLf + "balance sheet"
    'works with range
    'Worksheets("sheet2").Range("a1") = msg
    'doesn't work with textbox
    Worksheets("sheet2").TextBox1.Text = msg
    End Sub

    One more try please, just using a textbox, and I'll get out of your hair.
    Terry


    Please help

    Thanks
    Terry


    terrysoper1973
    View Public Profile
    Send a private message to terrysoper1973
    Find all posts by terrysoper1973
    Add terrysoper1973 to Your Buddy List

  4. #4
    Kris
    Guest

    Re: Having trouble with "vbcr"

    terrysoper1973 wrote:
    > Previous post was solved with vblf instead of vbcr, but won't work with
    > textboxes


    vbcrlf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1