+ Reply to Thread
Results 1 to 2 of 2

Comparing lines and removing duplicates

  1. #1
    Registered User
    Join Date
    pittsburgh, pa
    MS-Off Ver
    Excel 2003

    Comparing lines and removing duplicates

    I am writing some VBA to compare 2 lines and remove the duplicate.
    Here's how i have it set up.

    The spreadsheet will pull in data from a data base.
    There are 2 queries, the first query's data is not colored, the second query's data is colored with vb color #17.
    The program sorts by customer number.
    There is a possibility of duplicates from each query.
    Thats why i have them colored so i can compare the two lines, if an uncolored line matches a colored line, it needs to remove the colored line.

    Here's the code i am using. For some reason its not removing all the correct lines. its removing more than what i need somehow and i'm not sure where i'm going wrong. Please advise.

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010

    Re: Comparing lines and removing duplicates

    Hello christya24,

    Welcome to the Forum!

    Partial code postings are not particularly useful. It would be best if you post the workbook. With dealing with queries, and other data sources, there many factors that can adversely effect the code. These are the "hidden" problems that can only be seen when the whole workbook is available for review.
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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


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