+ Reply to Thread
Results 1 to 7 of 7

Delete Rows based on Multiple Name Criteria

  1. #1
    Registered User
    Join Date
    06-01-2012
    Location
    Boise
    MS-Off Ver
    Excel 2010
    Posts
    18

    Delete Rows based on Multiple Name Criteria

    Greetings,

    I have a pretty simple one that I can't get my arms around. Need a short VB script to run a macro that will delete entire rows based upon multiple criteria (Names with Spaces)

    In non tech terms my example is.... If Column B = John Smith or John Doe, or Jane Smith, or Carlos Hernandez then delete the entire row. (There are 8 names total)

    I have hunted around and not found anything yet that will properly do this.

    Any help would be greatly appreciated!

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Delete Rows based on Multiple Name Criteria

    Hi Graham,

    See if you can modify this with your criteria and give it a whirl. Don't forget about the correct sheet name.

    Please test on a sample first...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    06-01-2012
    Location
    Boise
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Delete Rows based on Multiple Name Criteria

    Worked PERFECTLY! Thanks
    Last edited by jeffreybrown; 10-14-2012 at 09:05 AM. Reason: Please do not quote whole posts...Thanks.

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Delete Rows based on Multiple Name Criteria

    You're welcome. Glad it worked out for you and thanks for the feedback

    If satisfied with the solution(s) provided, please don't forget to mark the thread as solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Registered User
    Join Date
    10-14-2012
    Location
    Japan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Delete Rows based on Multiple Name Criteria

    In the above example, the use of "AAAA", "BBBB", requires the criteria to be inputted in the VBA code. Is there a way to reference criteria in a column listed in a separate sheet of the same file?

    I have a database of about 3500 names listed on one sheet in column B. Each name has a row's worth of data assosciated with it; some of the names are repeated, but the associated data is different. This sheet is called "Crew Qual." I want to be able to input a separate list of names on a separate sheet in the same file: "Qual Math", range O6:O19, and have excel reference the inputted names, and delete the associated rows in the sheet "Crew Qual."

    I looked around in other forums, and have not found a good solution, can anyone help?
    Last edited by MXu; 10-14-2012 at 08:11 AM.

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Delete Rows based on Multiple Name Criteria

    @MXu,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  7. #7
    Registered User
    Join Date
    10-14-2012
    Location
    Japan
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Delete Rows based on Multiple Name Criteria

    Oh, sorry about that, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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