+ Reply to Thread
Results 1 to 3 of 3

Removing Rows with no values (blank) in specific columns

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Removing Rows with no values (blank) in specific columns

    I am looking for a function or some solution that will allow me remove rows from a large amount of data for which I am only concerned with certain columns that are populated. For example columns A,B,C,D will all have values but columns E-EX will only sometimes have data, I want to remove every row that does not have values located in say column G, X, ES, etc. Any help on this would be greatly appreciated.

    best,
    Ethan

  2. #2
    Registered User
    Join Date
    12-30-2011
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Removing Rows with no values (blank) in specific columns

    Hi there,

    This article - http://www.ozgrid.com/VBA/row-delete-criteria.htm - may be of use. Otherwise, there is plenty of of code out there. Just Google something like 'excel remove rows based on criteria'.

    HTH,

    Fermented R

  3. #3
    Registered User
    Join Date
    07-19-2011
    Location
    Boston, USA
    MS-Off Ver
    Excel 2010
    Posts
    23

    Re: Removing Rows with no values (blank) in specific columns

    I finally wrote this:

    Sub row removal()

    xrow = 2


    Do Until IsEmpty(Cells(xrow, 1)) = True


    If IsEmpty(Cells(xrow, 10)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 11)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 12)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 13)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 14)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 17)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 18)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 19)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 23)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 24)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 25)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 26)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 29)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 30)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 38)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 39)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 40)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 41)) = False Then GoTo Nextrow
    If IsEmpty(Cells(xrow, 135)) = False Then GoTo Nextrow

    Rows(xrow).Delete
    GoTo Nextrowdeleted
    Nextrow:
    xrow = xrow + 1
    Nextrowdeleted:
    Loop

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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