+ Reply to Thread
Results 1 to 8 of 8

Delete entire row for specific words

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Delete entire row for specific words

    Hello everybody

    I need a macro that enables me to select a range using inputbox ...
    As for selection I need to use (Intersect) method to focus on column D in my selection ...
    I need to put about seven words in an array , e.g (Cat1,Cat2,Cat3,Cat4,Cat5,Cat6,Cat7) ...

    If any cell in column D in that selection only not the whole column :: if any cell has any string of the array the macro delete the entire row

    Hope it is clear
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Delete entire row for specific words

    Hello YasserKhalil,

    See if this works for you :

    Please Login or Register  to view this content.
    GC Excel

    If this post helps, then click the star icon (*) in the bottom left-hand corner of my post to Add reputation.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Delete entire row for specific words

    Suggest you post a sample workbook. You should know this by now. Don't expect people to make a test environment before preparing a solution for you.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Delete entire row for specific words

    or maybe so
    Please Login or Register  to view this content.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,219

    Re: Delete entire row for specific words

    Hi Yasser,

    Here is your code:
    Please Login or Register  to view this content.
    You will need to select a range of cells by clicking on the worksheet and dragging the mouse. This is Type:=8 input.
    You should also look at the VBA code and add any "Cat" words you want searched for.

    Hope this is what you wanted.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Delete entire row for specific words

    Thanks a lot for this great and useful help
    You are awesome

    All the solutions offered are wonderful
    Thank you very much for this great and brilliant methods
    Last edited by YasserKhalil; 08-01-2015 at 03:08 PM.

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,219

    Re: Delete entire row for specific words

    Hi GC Excel,

    First - I really like your code, but I wondered about these things.

    1. What if the user selects cells that don't intersect with column D? You give an error message so that is ok.
    2. Was the question if the whole cell is "Cat1" or if "Cat1" is anywhere in the string in that cell?

    Still - I like your code and learned from it. But I interpreted the question with the points above included.
    If I wrote my code again, I'd add the Input string of words he is looking for. I liked that. We might also include a prompt for which column he is searching for the input words.

  8. #8
    Forum Expert
    Join Date
    08-02-2013
    Location
    Québec
    MS-Off Ver
    Excel 2003, 2007, 2013
    Posts
    1,414

    Re: Delete entire row for specific words

    @Marvin,

    Thanks for the feedback...

    2. Was the question if the whole cell is "Cat1" or if "Cat1" is anywhere in the string in that cell?
    You are correct. I should have write this instead since the search value can be anywhere in the cell:

    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. [SOLVED] keyword search - a macros to change font color for specific key words (not entire cell)
    By kingwhopper in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2014, 12:25 PM
  2. [SOLVED] Macro delete rows containing specific words
    By mcranda in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2013, 05:14 PM
  3. [SOLVED] delete entire row if it doesn't contains at least 1 of the words listed
    By 4evra in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-30-2013, 02:14 PM
  4. Delete blank row above cells with specific words.
    By beyre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2012, 02:17 AM
  5. [SOLVED] Delete entire row if the cell has three 3 or two 2 letter words
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-21-2012, 08:23 PM
  6. Delete entire row from A to F if cell A has specific content
    By vtech in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-02-2010, 06:01 AM
  7. Delete a Row if a cells contains specific words
    By jsolder in forum Excel General
    Replies: 1
    Last Post: 08-14-2009, 05:36 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