+ Reply to Thread
Results 1 to 8 of 8

VBA to delete entire row based on condition met

  1. #1
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    VBA to delete entire row based on condition met

    Hello,

    I have table in which against the Column A data values are added in Column B, C and D.

    If Column B,C and D cell values is 0, then I want entire row including A to be deleted. How can I do this in VBA?

    Note: Column A data begins from Row 15 and below.

    Just to avoid confusion. I want row deletion, only when all the three cell on B,C and D is = 0

    Please advice.

    THanks,
    Shiva
    Last edited by shiva_reshs; 06-16-2014 at 02:28 PM.
    Keep the Forum clean :


    1. Use [ code ] code tags [ /code ]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. Show appreciation to those who have helped you by clicking * Add Reputation below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA to delete entire row based on condition met

    Maybe:

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: VBA to delete entire row based on condition met

    Ah I created something similar:

    Please Login or Register  to view this content.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  4. #4
    Forum Contributor
    Join Date
    07-17-2012
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    715

    Re: VBA to delete entire row based on condition met

    Thanks.......

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA to delete entire row based on condition met

    You're welcome. Glad to help out.

  6. #6
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: VBA to delete entire row based on condition met

    John can you explain this piece:

    Please Login or Register  to view this content.
    I think I get all of it except the .End(3)(1).Row
    Last edited by mikeTRON; 06-16-2014 at 04:00 PM.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: VBA to delete entire row based on condition met

    You've probably seen it written differently. .End(3) is a shorter version of .End(xlUp). The (1) is a row offset command. It selects the last used row in a designated Column. (2) in the same position would select the first empty cell in a Column. When used together they select the last used cell in a Column. The .Row is of course the row number of the cell.

  8. #8
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: VBA to delete entire row based on condition met

    Thanks for the clarification. I ended up checking out the Excel Help section and found the same thing. I would imagine I am nowhere near as good as you so I use the explicit (XlUp) so I know what I am doing.

+ 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 the entire row if condition didn't match
    By sunheroj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 04:08 PM
  2. [SOLVED] VPA delete entire row if condition met & move upxit from macro
    By Alfie101 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-04-2012, 03:27 AM
  3. [SOLVED] Macro to delete entire row on a condition
    By kgonzalbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-30-2011, 12:39 AM
  4. Delete entire row on condition
    By bouitac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2009, 04:58 PM
  5. [SOLVED] Can I delete an entire row if condition is not met?
    By Christine in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-04-2006, 04:50 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