+ Reply to Thread
Results 1 to 6 of 6

delete rows where there are 3 or 4 cells with values > 0

  1. #1
    Registered User
    Join Date
    06-07-2013
    Location
    Chatham, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    delete rows where there are 3 or 4 cells with values > 0

    Hi

    I have 4 long columns of data and I want to detete all rows that contain either 3 or 4 values > 0. These could appear in any one of the columns so all 4 need to be examined to decide whether to delete a row. After deletion I presumably need to count back 1 row and then continue.

    Many thanks for any help.

    Beekster

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: delete rows where there are 3 or 4 cells with values > 0

    Hi,

    Assuming that the four columns to which you refer are A, B, C and D and that your data begins in row 2, in cell E2 enter this formula and copy down as required:

    =IF(COUNTIF($A2:$D2,">0")>2,"DELETE","")

    Filter this new column for DELETE and delete all rows.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: delete rows where there are 3 or 4 cells with values > 0

    Maybe:
    Please Login or Register  to view this content.
    Assuming your columns are A to D

  4. #4
    Registered User
    Join Date
    06-07-2013
    Location
    Chatham, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: delete rows where there are 3 or 4 cells with values > 0

    Beautiful!
    Many thanks

  5. #5
    Registered User
    Join Date
    06-07-2013
    Location
    Chatham, England
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: delete rows where there are 3 or 4 cells with values > 0

    equally effective as the other macro solution posted
    Many thanks

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: delete rows where there are 3 or 4 cells with values > 0

    or:

    Please Login or Register  to view this content.



+ 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 rows if values match in a block of cells
    By Premangshu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-21-2012, 05:47 AM
  2. Replies: 5
    Last Post: 11-12-2012, 08:38 PM
  3. Replies: 0
    Last Post: 06-12-2012, 02:00 PM
  4. How to delete all rows if any cells in the row contain certain values.
    By twills in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-14-2010, 03:38 PM
  5. Delete rows with numeric values, leave rows with text
    By GSpline in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2005, 08:05 PM

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