Closed Thread
Results 1 to 26 of 26

deleting new line character

  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 Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    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.
    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
    O365
    Posts
    20,436

    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
    Valued Forum Contributor 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
    O365
    Posts
    20,436

    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

  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
    O365
    Posts
    20,436

    Re: deleting new line character

    can you post an example workbook so we can read the actual text values.

  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
    O365
    Posts
    20,436

    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))

  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 Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    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
    O365
    Posts
    20,436

    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.
    Please Login or Register  to view this content.

  16. #16
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: deleting new line character

    just coz your info is confidential doest mean you couldnt post an example of a few cells deleting everything except the last and first letters
    martin
    wilson

    becomes

    n
    w

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

    Re: deleting new line character

    "3.0 Schedule
    C submitted the work progress chart as of end of 2.
    (Appendix)
    P advised C that ng
    the that
    productivity areas.
    According O, date
    of 02.
    This not
    be progress
    improves immediately.
    C intend to
    do time
    resolves chedule."


    is that any use??? just deleted txt in between.. but the start and ends sud be the same

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

    Re: deleting new line character

    i understand what ur saying with that code..

    but never used VBE immediate window before..

    can ya give me a quick run down with it??

  19. #19
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: deleting new line character

    We can not use anything you post as we have not idea what the copy/paste and post would have done to the text.

    Can you not copy 1 example to a new workbook and simply replace all the visible characters with X.

    To go to VBE press ALT+F11
    to goto immediate window press CTRL+G
    copy/paste the line of syntax and press ENTER on that line.

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

    Re: deleting new line character

    OH MY GOD...
    that does exactly what i want..

    probably pushing the boat out a bit now..
    but is there a way i can get that to work globably on the whole program??

  21. #21
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: deleting new line character

    You could try this in the immediate window

    Please Login or Register  to view this content.

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

    Re: deleting new line character

    A MILLION THANKS YOU..
    thank you thank you.. i think you just saved me about 3 weeks work there...

  23. #23
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: deleting new line character

    just as a question , have you saved the workbook first? replace alt+010 only works if the data has been saved in a work book
    you can't just open one stick in a load of data then use it.

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

    Re: deleting new line character

    ye.. all the data saved 1st.. so its ok that way..

  25. #25
    Registered User
    Join Date
    09-23-2008
    Location
    Slovakia
    Posts
    4

    Re: deleting new line character

    You can use the CLEAN function, which removes all non-printable characters.

    This worked well for me.

  26. #26
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: deleting new line character

    @xaver, please try to avoid posting to old threads - this thread for example has been dormant for over two years.

Closed 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