Adding carriage returns to cells from a userform
Adding carriage returns to cells from a userform
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Adding carriage returns to cells from a userform

  1. #1
    New Member
    Join Date
    Feb 2002
    Posts
    48
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi, I have a multiline textbox in a userform and would like to be able to:
    1. Hit return for a new line.
    2: Change the carriage returns to
    , the html version of a new line.
    Then copy the result into a cell.

    Please help I'm really stuck!

  2. #2
    New Member
    Join Date
    Apr 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hello Andy:
    1. On your userform property, make sure the textbox's enterkeybehavior is set to true, this enable the enter key to generate a new line.
    2. the new line character is either chr(13) then chr(10) or chr(10) then chr(13), I forget which one is the right one, but you can easily test it. just do a search and replace of both character with the html ones.
    example:
    dim strAns as string
    strAns = textbox1.text
    strAns = replace (strAns,chr(13) & chr (10)," ")

    3. not sure what you mean, but it should be easy once you got the string above?

    HTH
    lantiger

  3. #3
    New Member
    Join Date
    Apr 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    oops, guess I should disable HTML

    on the above post, where it has the replace function, it should be:
    strAns = replace(strAns, chr(13) & chr (10), "@nbsp;"

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Posts
    3,169
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    CHAR(10)
    Free Excel based Web Toolbar available here.

    Jack in the UK
    J & R Excel Solutions
    "making Excel work for you"

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com