+ Reply to Thread
Results 1 to 4 of 4

Delete Rows if cell value in a column are blank

  1. #1
    Registered User
    Join Date
    06-28-2010
    Location
    Midwest
    MS-Off Ver
    Excel 2003
    Posts
    4

    Delete Rows if cell value in a column are blank

    Greetings!

    I am trying to delete all rows of a excel table, if cell value in 'Column F5' onwards is blank.

    There are more than 3000 rows of records and data is sorted with blank columns at the end of the table.

    For example:

    In the attached .jpeg file, column C has blank cells from C9:C, and hence would like to DELETE all the rows from 9 through 3000 rows.

    Any advise, would be of great help!

    Thank much in advance.
    Attached Images Attached Images

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Delete Rows if cell value in a column are blank

    Hi excelrequest

    This code assumes that F4 has a header label. It'll filter the worksheet for all records with blanks in column F, row 5 downward and then delete all those rows. The procedure hasn't been tested.
    Please Login or Register  to view this content.
    Hope this helps.

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    06-28-2010
    Location
    Midwest
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Delete Rows if cell value in a column are blank

    Thank you John. I tried this code.

    Unfortunately, I get a Run time error 1004: "Autofilter method of Range class failed."

    Could this be due to the pivot table on which I am executing this code? Please advise.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Delete Rows if cell value in a column are blank

    Hi excelrequest

    Have no idea if auto filter works on pivot tables. Others on the forum can probably answer that question. My guess, and it's only a guess, is that you'd need to apply the filter to the data table.

    Can't you use pivot table features to filter from the table what you want?

    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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