Excel extra line

Posted on 2011-10-14
Last Modified: 2012-05-12
I need major help.... I have an huge excel file... many cells have multiple lines (2 lines). The 1st line has text and the 2nd line has one empty spot. I need to remove that blank spot (erase the second line). Instead of going into each cell and deleting it one by one (which will take me forever... there is about 1020 rows x 5 columns) is there a way to delete it all (get rid of that second line)....

see attached.

I'm using excel 2007
Question by:MrMay
    LVL 92

    Accepted Solution

    In another column, use a formula like this:


    Copy that down as needed.

    Then, copy the formula results, and use Paste Special / Values to copy over the original text.  Then delete the formulas.
    LVL 43

    Expert Comment

    by:Saqib Husain, Syed
    You can also try this macro

    Sub deltrailinglf()
    Dim cel As Range
    For Each cel In ActiveSheet.UsedRange.Cells
        Do While Right(cel, 1) = vbCr Or Right(cel, 1) = vbLf
            cel = Left(cel, Len(cel) - 1)
    Next cel
    End Sub

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Suggested Solutions

    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    This article will show you how to use shortcut menus in the Access run-time environment.
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now