+ Reply to Thread
Results 1 to 4 of 4

How to delete rows depending on cell content

  1. #1
    Registered User
    Join Date
    12-17-2009
    Location
    Kirkcaldy, Scotland
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2201) 64-bit
    Posts
    81

    How to delete rows depending on cell content

    Is it possible to delete rows of data depending on content of a cell? For example I have a spreadsheet of data such as below but I want to delete rows with repeated sizes (in column E) based on the code in column A

    Existing Data Spreadsheet.JPG

    So that it looks like this:

    Wanted Data Spreadsheet.JPG

    Any ideas?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to delete rows depending on cell content

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.

    Please don't upload pictures they are rarely much use and not many of us are prepared to recreate your workbook from a picture.

    In general though use a helper column to count the number of values, and filter the list for values > 1 in the helper column.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: How to delete rows depending on cell content

    A regular formula will not delete rows for you, but a formula/function will be able to show you which rows to delete (manually)

    E
    F
    2
    1
    FALSE
    3
    2
    FALSE
    4
    3
    FALSE
    5
    1
    TRUE
    6
    2
    TRUE
    7
    3
    TRUE
    8
    1
    TRUE
    9
    2
    TRUE
    10
    3
    TRUE


    F2=COUNTIF($E$2:E2,E2)>1 copied down.

    then apply filters, unckeck FALSE and delete what remains - then remove filters
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    12-17-2009
    Location
    Kirkcaldy, Scotland
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2201) 64-bit
    Posts
    81

    Re: How to delete rows depending on cell content

    Hi,

    Please see sample data attached to give a better idea of what I want to do, if possible please advise the formula to use and method to prevent me having to manually delete rows.Sample data.xls

+ 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] Would like to delete rows based on cell content
    By cindywylie in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-27-2014, 01:14 PM
  2. [SOLVED] Delete part of rows, depending if there is a value or not in a cell
    By excelactuary in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-08-2013, 08:28 AM
  3. Macros auto hiding of rows depending on cell content
    By nad23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2012, 12:40 PM
  4. Need help to delete rows based on cell content
    By iturnrocks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2008, 12:10 PM
  5. Delete Rows on cell content?
    By fpd833 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-10-2005, 05:06 PM

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