+ Reply to Thread
Results 1 to 6 of 6

Matching Data between Files , Deleting Matching Rows

  1. #1
    Registered User
    Join Date
    05-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Matching Data between Files , Deleting Matching Rows

    This forum has been absolutely amazing in helping me prep some data I have for a major DB import! Hopefully, you wonderful gurus can help me one last time.

    I need a macro that will let me compare values from workbook to values in another, and then delete the rows that match.

    Attached you will find two spreadsheets (Legacy Data Sample is only a small sample of a 15k record spreadsheet).

    I need to check column A of worksheet 1 in SSMC DELETE against column K in worksheet 1 of Legacy Data Sample. For matching values, I need to delete the entire row in the Legacy Data Worksheet.

    Then, I need to check column A of worksheet 2 in SSMC DELETE against column H in worksheet 1 of Legacy Data Sample. For matching values, again, I need to delete the entire row in the Legacy Data Worksheet.

    If anyone can help, it will be much appreciated! Thanks in advance!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Matching Data between Files , Deleting Matching Rows

    can you not do it in the db using sql?

  3. #3
    Registered User
    Join Date
    05-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Matching Data between Files , Deleting Matching Rows

    Hi Nathan,
    Unfortunately, I am but a lowly tech support guy. I don't have sql access to the database and the admins who do are the ones that tasked me with this as they are "too busy" to prioritize it. I only have access to a front-end user interface that can't run any kind of queries, so any data matching with conditional actions like this have to be done in excel.

  4. #4
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Matching Data between Files , Deleting Matching Rows

    Please Login or Register  to view this content.
    I haven't double checked this

  5. #5
    Registered User
    Join Date
    05-15-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Matching Data between Files , Deleting Matching Rows

    Hi Nathan,
    Thanks for the code!

    I just tried it, but no effect.

    Here is what I did.
    1) Opened ssmc delete.xlsm,
    2) alt+F11 to open visual basic,
    3) copied the code in, changed the file paths for the locations of the two spreadsheets
    4) saved as macro
    5) pressed F5 to run

    VB returned a message to confirm that I wanted to re-open the file. I clicked okay, and the file was re-opened along with Legacy Data sample -- but no other changes were made.

    I'm a total novice at VB Macros, so any more help you can give would be appreciated. Thanks!

  6. #6
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Matching Data between Files , Deleting Matching Rows

    sorry, do it from a new workbook.

+ 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