Results 1 to 6 of 6

remove carridge return / line feed symbol ??

This is a discussion on remove carridge return / line feed symbol ?? within the Excel Questions forums, part of the Question Forums category; when i type into text box on user form (use enter for multi line) i get symbol at the end ...

  1. #1
    New Member
    Join Date
    Jul 2010
    Posts
    41

    Default remove carridge return / line feed symbol ??

    when i type into text box on user form (use enter for multi line) i get symbol at the end where i hit enter (think it may be carridge return or line feed, not too sure)

    Example typed into text box

    mr jones
    53 albert street
    axas 234

    Returned Value in cell is

    mr jones ||

    53 albert street||

    axas 234||

    or something to that effect

    how to i remove these symbols?????

    help please

  2. #2
    Board Regular
    Join Date
    Aug 2008
    Posts
    314

    Default Re: remove carridge return / line feed symbol ??

    You could try this

    =SUBSTITUTE(A1,CHAR(13),"")

    or possibly

    =SUBSTITUTE(A1,CHAR(10),"")

  3. #3
    New Member
    Join Date
    Jul 2010
    Posts
    41

    Default Re: remove carridge return / line feed symbol ??

    where am i putting that

    in the vba or in the cell??

    thank you for reply

  4. #4
    Board Regular
    Join Date
    Aug 2008
    Posts
    314

    Default Re: remove carridge return / line feed symbol ??

    You would put the formula in a cell, assuming that the cell with the text is A1.

    Now I've thought about this some more and tried it myself I'm not sure what the problem is. Where do you see these extra characters? I've tried typing text with carriage returns into a text box on a form and then set a cell value to the text in the box and there are no extra characters.

  5. #5
    Board Regular
    Join Date
    May 2010
    Posts
    93

    Default Re: remove carridge return / line feed symbol ??

    It looks like you're using vba to capture something typed and save it into a text file, as that's the only time i've had carriage return/line feed problems. Using the formula given earlier in a worksheet would work fine at returning the information without the linefeed/carriage return within another cell of the worksheet, but if you're using vba to write values to a text document or interpret what you put on a form and put it into a cell, you need to edit your vba to strip out those lf/cr's and writeline will add the appropriate symbol to the end of the line without a visible symbol appearing.

  6. #6
    Board Regular
    Join Date
    May 2010
    Posts
    93

    Default Re: remove carridge return / line feed symbol ??

    using

    NameInput = Form.inputbox
    cells("A1").value = NameInput

    would need to be changed to

    NameInput = Form.inputbox
    NameInput = Replace(NameInput, chr(13), "")
    NameInput = Replace(NameInput, chr(10), "")
    cells("A1").value = NameInput



    If you could paste the form code for us we could probably be more accurate at what you need done.

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