1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Removing blank lines in Excel

Discussion in 'Business Applications' started by gurutech, Oct 10, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. gurutech

    gurutech Thread Starter

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    I have a huge excel file (3 sheets, all filled to the 65535 row limit).

    I need to remove all "blank" lines easily, but due to the nature of the data, I can't do a "sort" to bring all the blank lines to one location in the file. Is there an excel feature to do this, or a macro?

    Thanks!
     
  2. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    T free add-in for Excel, ASAP Utilities has an easy tool to do so - just go to http://www.asap-utilities.com/ to download it, then you can use "Columns and Rows, remove all empty rows" to do it.
    One caveat - if you have some unusual formatting, such as merged cells, that extend over blank cells, you will lose that.
     
  3. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    ASAP.

    Column & Rows > Remove All Empty.

    :)
     
  4. gurutech

    gurutech Thread Starter

    Joined:
    Apr 23, 2004
    Messages:
    2,960
    Will that remove "all" rows AND columns, or just one or the other?

    I did find a way to do this, but it took a little work... filter by a column that I know has no values in it, to show only "non-blanks" - so only rows with data in that column will appear. Then it's a copy/paste to a new tab in Excel. Repeat for the other two tabs (copy data to the same "new" tab...)

    Then delete the 3 "old" tabs...
     
  5. MRdNk

    MRdNk

    Joined:
    Apr 7, 2007
    Messages:
    439
    Too much data, move it to MS Access. Do you have MS Access?
     
  6. bomb #21

    bomb #21

    Joined:
    Jul 1, 2005
    Messages:
    8,546
    "Remove all empty rows" is "option 1"; "remove all empty columns" is "option 2". Run both to remove both.
     
  7. Keebellah

    Keebellah Trusted Advisor

    Joined:
    Mar 27, 2008
    Messages:
    6,591
    First Name:
    Hans
    Simple vba code:
    lastrow = Range( "A65536").end(xlup).row
    For y = LastRow To 2 Step -1
    If Cells(y, x).Value = "" Then Cells(y, x).Delete shift:=xlUp
    Next y

    Set the range to the the column desired, in this case "A"
    Lastrow checks the last row and starts from the end up.
    Removes all empty rows entirely up to row 2 because row 1 generally is the header

    Happy coding
     
  8. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Removing blank lines
  1. laurenme
    Replies:
    3
    Views:
    235
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/757912

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice