+ Reply to Thread
Results 1 to 6 of 6

Macro to Delete Data in one worksheet based of the data that is in another worksheet.

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago Land
    MS-Off Ver
    Excel 2007
    Posts
    5

    Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    Hello, I have two sets of data. in sheet1 I have a list of people. In sheet 2 I have a list of people that need to be deleted from sheet1. I want to create a macro so that if any cell in column A sheet1 is equal to any of the data that is in column A sheet 2 to delete the entire row in sheet1. This is just a small sample as I have 1000's of lines (people). Any help would be greatly appreciated! Thanks!

    Marc


    Sheet1
    Column A
    Marc
    Beth
    Michelle
    Sarah
    Shelly
    Lynda
    Marc
    Casey
    Sarah
    Robert
    Seth
    Shelly
    Debbie
    Robert
    Marc
    Sarah


    Sheet2
    Column A
    Marc
    Shelly
    Robert
    Last edited by shortma; 09-14-2012 at 05:18 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    Maybe something like this?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago Land
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    Not sure what I did wrong. It worked one time and but didn't delete all the names in sheet1 that were equal to sheet2. I have attached the file. When I run the macro I need all the Marc's, Robert's and Shelly's to be deleted from sheet1. My data is much bigger that is just small sample I provided. Thanks again!
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    Some of your text has extra spaces. Try the revision.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    Chicago Land
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    Thank You! It works great!

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Macro to Delete Data in one worksheet based of the data that is in another worksheet.

    @ shortma

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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