+ Reply to Thread
Results 1 to 7 of 7

Delete Entire row if cells are blank

  1. #1
    Registered User
    Join Date
    10-08-2015
    Location
    Arizona
    MS-Off Ver
    2013
    Posts
    2

    Delete Entire row if cells are blank

    I have a workbook that i am working on and trying to piece together a macro for it. I need a code that will delete entire row if cells in column D, E, and F are blank. I've tried a few that i found online but they either did not work properly or just took forever to run. Hoping you guys can help!!

    Range of data on the sheet is Columns A through F and down to row 600.

  2. #2
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Delete Entire row if cells are blank

    Assuming column A is full (it will find the last row)
    Please Login or Register  to view this content.
    If column A is scatter shot and you are sure 600 is the max rows you will have
    Please Login or Register  to view this content.
    Last edited by Neil_; 09-28-2016 at 01:26 PM.
    Frob first, tweak later

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Delete Entire row if cells are blank

    A slightly different approach:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Valued Forum Contributor Neil_'s Avatar
    Join Date
    04-19-2013
    Location
    Yorkshire
    MS-Off Ver
    Office 365 Enterprise E3 2013 / 2016
    Posts
    479

    Re: Delete Entire row if cells are blank

    Hi Olly
    With .Range("D1", .Cells(Rows.Count, "F").End(xlUp))
    Cells in D, E and F may be blank at the bottom of the sheet, so the last few won't be filtered.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Delete Entire row if cells are blank

    Quote Originally Posted by Neil_ View Post
    Hi Olly


    Cells in D, E and F may be blank at the bottom of the sheet, so the last few won't be filtered.
    That doesn't matter. If there's something in them, then those rows wouldn't be deleted. If there's nothing in them, then they're just blank rows below the used range.

  6. #6
    Registered User
    Join Date
    10-08-2015
    Location
    Arizona
    MS-Off Ver
    2013
    Posts
    2

    Re: Delete Entire row if cells are blank

    Thanks Neil. Both work perfectly but i am sure will not have more than 600 rows so i used the second one. Saved the first one just incase it ever does go over.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,692

    Re: Delete Entire row if cells are blank

    Another possibility.

    Please Login or Register  to view this content.

+ 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. [SOLVED] Delete entire row if Column C is blank
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2014, 12:03 PM
  2. Compare two cells, if blank delete entire row
    By taichi56 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2013, 02:05 PM
  3. [SOLVED] How to Delete Entire Row if Range of Cells are Blank?
    By mrodrigues in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-10-2012, 09:42 PM
  4. Replies: 1
    Last Post: 05-10-2012, 04:58 PM
  5. Delete entire row if certains cells are blank
    By ZH1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2011, 01:42 PM
  6. Search column A for blank cells and delete entire row
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-22-2009, 07:59 AM
  7. [SOLVED] Easiest way to delete blank cells in column (not entire row)
    By sramsey in forum Excel General
    Replies: 4
    Last Post: 02-16-2006, 12:30 PM

Tags for this Thread

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