+ Reply to Thread
Results 1 to 8 of 8

Delete Row if 3 conditions are met

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Delete Row if 3 conditions are met

    Hello:

    Please refer to attached file.
    Sample data is attached.
    Would need to find last row and start deleting from bottom up.
    I need a VB Code to delete the row if following conditions are met

    Delete Row if value in Column D,E and F is all zero.


    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Delete Row if 3 conditions are met

    Well, based on your sample file, give this a try.

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    10-05-2014
    Location
    Regina, SK Canada
    MS-Off Ver
    Excel for Mac 11
    Posts
    330

    Re: Delete Row if 3 conditions are met

    Here's a similar solution that ensures each of the 3 cells is zero, not just their sum.

    Please Login or Register  to view this content.
    Last edited by StuCram; 05-14-2015 at 06:11 PM. Reason: fixed typo

  4. #4
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Delete Row if 3 conditions are met

    Hi Guys:

    Both solution works great.
    Thanks a lot
    Riz

  5. #5
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Delete Row if 3 conditions are met

    Hi Guys:

    I needed to add one more criteria.
    If value is "000-00-0000" in column B delete Row.
    Please let me know if you have any questions.
    Thanks.
    Riz

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Delete Row if 3 conditions are met

    Hi Riz,

    Try this slightly modified macro by JieJenn:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  7. #7
    Forum Contributor
    Join Date
    03-21-2012
    Location
    Ho Chi Minh city
    MS-Off Ver
    Excel 2003
    Posts
    180

    Re: Delete Row if 3 conditions are met

    I needed to add one more criteria.
    If value is "000-00-0000" in column B delete Row.
    Please let me know if you have any questions.
    Thanks.
    Riz
    PHP Code: 
    Sub ArrayDelete()
     
    Dim Arr(), Rng As Range
     Dim J 
    As LongAs LongAs ByteCol As Byte
     
     Set Rng 
    = [b5].CurrentRegion
     Arr
    () = Rng.Value:             Col Rng.Columns.Count
     ReDim dArr
    (1 To Rng.Rows.Count1 To Col)
     For 
    1 To UBound(Arr())
        If 
    Arr(J2) = "000-00-0000" And Arr(J4) = And Arr(J5) = And Arr(J6) = 0 Then
        
    Else
            
    1
            
    For 1 To Col
                dArr
    (WZ) = Arr(JZ)
            
    Next Z
        End 
    If
     
    Next J
     
    If W Then
        Rng
    .Value ""
        
    Rng(1).Resize(WCol).Value dArr()
     
    End If
    End Sub 

  8. #8
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: Delete Row if 3 conditions are met

    Hi Trebor:

    Works for me great.
    Thanks a lot..
    Riz

+ 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 Row under certain conditions
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-28-2012, 09:07 PM
  2. Delete rows with conditions
    By mridzuani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2008, 02:52 AM
  3. [SOLVED] Re: delete row based on conditions
    By Jimmy Joseph in forum Excel General
    Replies: 2
    Last Post: 06-24-2006, 08:10 PM
  4. Re: delete row based on conditions
    By Jimmy Joseph in forum Excel General
    Replies: 0
    Last Post: 06-24-2006, 05:00 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