+ Reply to Thread
Results 1 to 11 of 11

Comparing one column to another for duplicates

  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Comparing one column to another for duplicates

    Hello all,

    I am trying to figure out a macro that will compare one column, "H" in Sheet1, to column "A" in Sheet3. I have seen the VBA code for this a while back and can't seem to find it now. I have tried a few simple codes but it is not working for me. I have tried the code with small numbers, A1:A5, but i need it on a larger scale. Any help is greatly appreciated.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    Why can not you Index and Match formula?

  3. #3
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Comparing one column to another for duplicates

    I'm still learning excel formulas and VBA. I chose VBA because I have seen the code before but do not remember what it was

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    There are many ways of comparing columns. Please attach a sample and show us the desired result.

  5. #5
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Comparing one column to another for duplicates

    Here is the example. I hope I explained it good enough.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    Are you matching the master with new list or compare list? If it is new list, there is no match? What do you mean by return to new column? Which one is the new column?

  7. #7
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Comparing one column to another for duplicates

    comparing the master list to the compare list. if there is a number that is in the compare list that is not in the master list, then that new number is returned to an empty column "new list"

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    You can use the find and match functions which may be easier for you to understand than using a dictionary object.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    As I said, there are dozens ways of doing the same task. This is one of them. Others may come up with a different code.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Comparing one column to another for duplicates

    Thank you, I will try it out! I appreciate all the help!

  11. #11
    Registered User
    Join Date
    07-01-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Comparing one column to another for duplicates

    AB33,

    this is what i am looking for, however, i need it to compare one column (list1) on sheet1 with another column on another sheet2 (Master List). is that possible? I changed the names of the sheets, but nothing happened. I am not sure what I did wrong. Any help is greatly appreciated.

    Thank you,
    cmp3182

  12. #12
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Comparing one column to another for duplicates

    Please attach the new sample

+ 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] Find duplicates in column A, add values from column B (possibly delete duplicates)
    By luarwhite in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-12-2013, 04:34 PM
  2. [SOLVED] Comparing 2 columns and deleting duplicates in the second column according first column
    By wingo033 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-19-2012, 07:14 PM
  3. Comparing two columns for duplicates
    By michaelrusk in forum Excel General
    Replies: 1
    Last Post: 07-16-2012, 09:18 AM
  4. comparing the column headers, then deleting the entire column iif duplicates occur
    By vindieselgal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-25-2011, 04:53 AM
  5. Comparing Two columns to create column with duplicates
    By braves1t in forum Excel General
    Replies: 6
    Last Post: 04-29-2010, 08:31 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