Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    deleting new line character

    A have a worksheet in excel which was copied from pdf.
    in each cell number of different lines, the data appears on a new lines. the same as using the new line character. (ALT + ENTER)

    The document is huge. well over 3000 individual cells, and generally 4 or 5 lines in each one. Is there anyway i can globally change the whole documents. Just deleteling all the new lines??

    Using excel 2007 on windows xp..

  2. #2
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,111

    Re: deleting new line character

    Edit > Replace, in the Find what box, press and hold the Alt key, and on the NUMERIC keypad, type 0010 , then Replace All.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    unfortunately nothing is happening. when i press and hold alt.. and type in the numeric code.. nothing is happening. the box is just remaining empty. any idea why this might be?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,906

    Re: deleting new line character

    The new line character does not have a displayed character, like a normal letter.
    What you should notice though is the cursor will drop in the Find Text box as it has moved to the next line.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Forum Guru Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264

    Re: deleting new line character

    I am also unable to use the Alt+numeric keypad route to generate new lines (and tabs and carriage returns). I have yet to discover why (and I have been looking for a while and have asked the great and the good in the online forums!).

    An alternative method to get one is just to use the following formula in an empty cell:

    =CHAR(10)

    and copy and pastespecial values on this cell. Then with the cell selected use F2 to edit and select the new line character (which may well appear as simply a new line in the cell) and Ctrl+C to copy it - then you should be able to Ctrl+V in the Edit>Replace dialog.

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,906

    Re: deleting new line character

    I don't think you can get NewLine or CarriageReturn by using
    ALT+010 or ALT+013 on the numeric keypad when editing a cell.

    The ALT+010 works in the FIND/REPLACE dialog
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    When i try that.. the find/replace function isn't reading the character.

    Maybe if i give an example of what i am trying to do it, there might be another way to do it..

    For Example

    My Name
    is
    John. I Live in a
    house


    This is way i have the data..

    I want to be able to present it like

    My names is john. I liive in a
    house.

    and let it go on to a new line when it reaches the end of the cell

  8. #8
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    when i try that. the alt+010.
    its returns a message saying its excel can't find a match.
    is it possible that excel is reading it as something different since it was copied in..

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,906

    Re: deleting new line character

    can you post an example workbook so we can read the actual text values.
    Cheers
    Andy
    www.andypope.info

  10. #10
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    the data i am working on is all private.. and i'm i think if i start altering so that its ok to put but, i'll just be changing it to much..

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,906

    Re: deleting new line character

    Assuming cell with text in is A1 enter this in B1 and copy down for enough rows to cover the length of the text.

    =CODE(MID($A$1,ROW(),1))
    Cheers
    Andy
    www.andypope.info

  12. #12
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    was messing bout there.. and if i wish the TRIM function in the text fucntion. it will print it all on line. the problem still remains though. if i double click in the cell and then outside it again it resorts back to the original. however. before this. the lines appear as a (excuse the lack of techinal symbol) a box with a question mark in it.

    if one types =char(10) this is symbol. all i want to do at this stage it replace this symbol with a space but sitll having the same problem

  13. #13
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,477

    Re: deleting new line character

    try to find what code it is by puting cursor at end of last word of first row and delete just the letters using back space , then use =code(a1) on mine it returns 10 but you may have a different one in there from where it was copied
    so
    martin
    wilson
    test
    becomes
    wilson
    test

  14. #14
    Registered User
    Join Date
    01-28-2009
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: deleting new line character

    andy.. i am presuming that peice of code you show me.. represents the ascii codes for the individual characters.. showing the character up as 10. been the space.. wat i want to do it change this '10' to a '32' .. 32 been the spacebar character..

  15. #15
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    2003 & 2007 & 2010
    Posts
    10,906

    Re: deleting new line character

    I know and the suggested find/replace would normally work.

    As you can not post an example of the cell so we can confirm I gave you a formula to display the numeric value of all of the characters.
    Is 10 in the correct place of the new line?

    You could try this in the VBE immediate window.
    Code:
    activecell.Value = replace(activecell.Value,chr(10)," ")
    Cheers
    Andy
    www.andypope.info

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.2.0