+ Reply to Thread
Results 1 to 8 of 8

Erase unnecessary Line Breaks in the cells

  1. #1
    Registered User
    Join Date
    10-19-2008
    Location
    Tokyo
    MS-Off Ver
    MS Offuce 2019
    Posts
    45

    Erase unnecessary Line Breaks in the cells

    Hi

    Like it says in the topic title , I want to erase all line breaks which I am not using from my work sheet. But still keeping the line breaks which has something written to it.

    Since my English isn't good please think this as a example of one cell.

    -------------------------------------------
    - Example text number 1
    - Example text number 2
    - Example text number 3
    - Example text number 4
    - Example text number 5
    ---------------------------------------------

    Using "Find & Replace" I got to replace the ones I want to erase with nothing, so its blank. Too bad the Excel doesn't replace the line breaks with it, so this is what I get.

    -------------------------------------------
    - Example text number 1
    - Example text number 2

    - Example text number 4

    ---------------------------------------------

    The result which I want to have is:

    -------------------------------------------
    - Example text number 1
    - Example text number 2
    - Example text number 4
    ---------------------------------------------

    I know about the Clean Function but that function eases all the line breaks from the cell, which I dont want to.

    So my question is can the excel do this?
    If not that whould mean that I have to delete the line breaks by hand for hundreds of cells.

    Sincerely
    artner

  2. #2
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    For the cell A1
    Please Login or Register  to view this content.
    Replace 2 line breaks with only 1 line breaks
    I need your support to add reputations if my solution works.


  3. #3
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    This may be easier to understand and use
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-19-2008
    Location
    Tokyo
    MS-Off Ver
    MS Offuce 2019
    Posts
    45
    Thank you sglife

    With out this I would have spent an hour or even more deleting one line break after another.

    Your first code was easy to understand too. I just didn't know that I could insert line breaks in the code too.

    Sincerely
    artner

  5. #5
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    You are welcome.
    Excel can do so many things that I could not believe before.

  6. #6
    Registered User
    Join Date
    09-23-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Erase unnecessary Line Breaks in the cells

    Hi,

    I am trying to erase blank line breaks by following the above tread but it seems that it is not working for me

    My cell looks like the below

    Comment 1





    Comment 2
    Comment 3



    Comment 4




    Now I want the result to exclude the line breaks and show as below

    Comment 1
    Comment 2
    Comment 3
    Comment 4

    Please help

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Erase unnecessary Line Breaks in the cells

    bushra,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  8. #8
    Registered User
    Join Date
    09-23-2013
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Erase unnecessary Line Breaks in the cells

    Sorry Admin, I didn't realize it yesterday. Will take care from next time.

    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula to add up cells with certain characters
    By tmac2o03 in forum Excel General
    Replies: 5
    Last Post: 04-20-2008, 04:18 PM
  2. sorting merged cells
    By Bope in forum Excel General
    Replies: 0
    Last Post: 04-07-2008, 11:56 AM
  3. #DIV/0! error where there was none before
    By DUAL in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-03-2008, 08:08 AM
  4. searching merged cells
    By chris_mayer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2006, 11:14 AM
  5. 'Filter/Clean' Cells; 2 questions
    By EHS in forum Excel General
    Replies: 12
    Last Post: 11-15-2006, 07:32 AM

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