+ Reply to Thread
Results 1 to 9 of 9

VBA Delete Rows If All Specific Columns Are Blank

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA Delete Rows If All Specific Columns Are Blank

    Hi, I wonder whether someone may be able to help me please.

    I'm trying to put together a small script which deletes rows if the cells in columns D:Q are blank starting at row 8.

    I thought I'd found a solution here http://stackoverflow.com/questions/1...-columns-empty which I could then adapt.

    Please Login or Register  to view this content.
    The problem I have is that I'm a little unsure how to start from row 8 and the code currently deletes rows where any cell is blank whereas I would like the condition to be where columns D:Q are all blank.

    I just wondered whether someone may be able to look at this please and offer some guidance on how I may go about achieivng this.

    Many thanks and kind regards

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: VBA Delete Rows If All Specific Columns Are Blank

    maybe
    Please Login or Register  to view this content.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Lightbulb Re: VBA Delete Rows If All Specific Columns Are Blank

    If there is any data in any cell between Column D & Column Q of the 1st row, then the following would return FALSE
    Please Login or Register  to view this content.
    using this, we can try:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Try:

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  5. #5
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Try this (I assume that column A contains values until the end of range):
    Please Login or Register  to view this content.
    Click on the star if you think I helped you

  6. #6
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Hi @JosephP, thank you very much for taking the time to reply to my post and for putting the code together which is exactly what I was after.

    All the best and kind regards

  7. #7
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Hi @jewelsharma, thank you for taking the time to reply to my post and for putting together the solution.

    The only very slight drawback was that I would need to amend the code to take into account a changing end row, whereas I was looking for this to be calculated automatically as per the solution from @JosephP.

    All the best and kind regards

  8. #8
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Hi @millz, thank you for taking the time to reply and provide the code which works great.

    All the best and kind regards

  9. #9
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA Delete Rows If All Specific Columns Are Blank

    Hi @adyteo, thank you for taking the time to come back to me with this and for the code you kindly provided which works great.

    All the best and kind regards

+ 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. Delete any blank rows from specific columns
    By tantcu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-23-2013, 03:45 PM
  2. Delete 1 to 8 rows. Do text to columns to specific columns.
    By niceblue in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2013, 10:53 AM
  3. [SOLVED] VBA Find last row and column that contain data and delete all blank rows and blank columns
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2012, 01:07 PM
  4. delete rows where a cell is blank in specific column
    By GottaRun in forum Excel General
    Replies: 3
    Last Post: 03-07-2006, 01:40 AM
  5. [SOLVED] To Delete the specific rows when blank is found on column A
    By ddiicc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2005, 01:05 AM

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