Results 1 to 3 of 3

Deleting all rows that don't contain a word

This is a discussion on Deleting all rows that don't contain a word within the Excel Questions forums, part of the Question Forums category; Hello, Please can you help? I need to do this: R1 R2 R3 R4 R5 R6 ... C1 a bc ...

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Working in Devon, England
    Posts
    4

    Default

    Hello,

    Please can you help? I need to do this:

    R1 R2 R3 R4 R5 R6 ...
    C1 a bc def 123 rgt rdf <--- delete this row
    C2 Word fgh poi kij 76 u <--- leave this row
    C3 kjl gt hu f5 h9 787 <--- delete this row
    C4 u78 hu g78 fv k0 h8 <--- delete this row
    C5 Word b7 de4 xsd fght pl <--- leave this row
    C6 Word gtyg tgt ii8 uy8 098 <--- leave this row
    C7 gfh hghg yu 098ju iu jhy7 <--- delete this row
    ...

    If anyone can help, it will be greatly appreciated.

    Thank you.

    Best Regards
    Clinton

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,579

    Default

    Hi Clinton
    The easiest way is to use the data autofilter. Use the custom filter on Column C, towards the bottom in the drop down box select - Does not contain - type Word in the box to the right. This will then filter out all rows that do not have Word in them. Then just delete those rows.
    Hope this helps
    regards
    Derek

    [ This Message was edited by: Derek on 2002-04-08 06:24 ]

  3. #3
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    65,222

    Default

    Lets say that A4:G11 houses the sample you provided:

    {"R1","R2","R3","R4","R5","R6","R7";
    "C1","a","bc","def",123,"rgt","rdf";
    "C2","Word","fgh","poi","kij",76,"u";
    "C3","kjl","gt","hu","f5","h9",787;
    "C4","u78","hu","g78","fv","k0","h8";
    "C5","Word","b7","de4","xsd","fght","pl";
    "C6","Word","gtyg","tgt","ii8","uy8",98;
    "C7","gfh","hghg","yu","098ju","iu","jhy7"}

    Make sure that row 4, which contains labels, formatted distinctly, e.g., in bold and double underlined, and row 1 to 3 are empty before the row that contains labels that go with your data.

    In A1 enter: R2
    In A2 enter: Word

    Activate A5.
    Activate Data|Filter|Advanced Filter.
    Check Copy to another location.
    make sure that List range is: $A$4:$G$11.
    Enter $A$1:$A$2 in the box for Criteria range.
    Enter $I$1 in the box for Copy to.
    Click OK.




Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com