Results 1 to 5 of 5

Thread: Delete Empty Rows

  1. #1
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    14

    Delete Empty Rows

    This is what I use to delete empty rows - is there a way I can get it to skip the first 3 rows - I really like this one as it is very quick. I suppose I could put a fony value in A1:A3 - then set them = vbnullstring after (but I really dont want to do so).



    Code:
    ActiveSheet.Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    xl2007 - Windows 7
    xl hates the 255 number

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    Code:
     
    Application.Intersect(ActiveSheet.Columns(1).Cells(4).Resize(Rows.Count - 4 + 1), ActiveSheet.Columns(1).SpecialCells(xlCellTypeBlanks)).EntireRow.Delete
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    This would be more elegant though
    Code:
    ActiveSheet.Cells(4, 1).Resize(Rows.Count - 4 + 1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  4. #4
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    By the way, why do you want to delete the entire range all the way to the last row in the sheet? Shouldn't you be using a more dynamic one based on the last filled cell of the column?

    Like
    Code:
        With ActiveSheet
            .Range(.Cells(4, 1), .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row, 1)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
        End With
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  5. #5
    Senior Member
    Join Date
    Apr 2011
    Posts
    190
    Rep Power
    14
    My column A is a position column - so it always have a value - if the record is valid. So your answer is perfect - tyvm
    xl2007 - Windows 7
    xl hates the 255 number

Similar Threads

  1. Delete Rows Based on Conditions
    By AbiG2009 in forum Excel Help
    Replies: 6
    Last Post: 12-26-2018, 01:24 PM
  2. Delete Entire Row For All Empty Cells In Column
    By johnreid7477 in forum Excel Help
    Replies: 4
    Last Post: 06-15-2013, 05:50 AM
  3. Replies: 13
    Last Post: 06-10-2013, 09:05 AM
  4. Delete Rows
    By ayazgreat in forum Excel Help
    Replies: 2
    Last Post: 12-13-2012, 11:48 AM
  5. Delete unwanted rows & column
    By sanjeevi888 in forum Excel Help
    Replies: 1
    Last Post: 09-30-2012, 08:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •