+ Reply to Thread
Results 1 to 3 of 3

Compare 2 other columns if first one matches

  1. #1
    Registered User
    Join Date
    10-20-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Compare 2 other columns if first one matches

    Hi,

    I need a macro that will check a given sorted column say A and if a given condition matches i.e. if more than one subsequent cell has the same value then it should perform the following operation -

    Check if the respective cells in column B and C are the same for the same subsequent Cells in the same Column if so it should do nothing but if >=3 values of B or C are varying for the same value of A it should Flag those rows.

    Example:

    Row Nos; A;B;C;
    1;New Jersey;George;cats
    2;New Jersey;George cats
    3;New Jersey;Albert dogs
    4;New Jersey;Donald rats
    5;Texas Sally;cats
    6;Texas Sally;dogs
    7;Texas Robert;cats

    In this Example 1, 2, 3 and 4 should be flagged or selected but the remaining i.e. 5, 6, 7 should not be selected.

    I am working on data that contain 1-2 thousand rows and about 20 columns.

    As I am new to programming can someone please create something which I can test out and change things if required to get the desired result.

    Appreciate your help and cooperation in this matter.

    Thanks,
    Clive.

  2. #2
    Registered User
    Join Date
    10-20-2011
    Location
    hyderabad, India
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Compare 2 other columns if first one matches

    Hi,

    Could someone please help me start something in this direction?

    When I use arrays I am able to get the entire column into an array but not a specific range within the column.

    Please help me out.

    Thanks,
    Clive.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    2016 Win10
    Posts
    7,156

    Re: Compare 2 other columns if first one matches

    Can you post a workbook with sample data, with before and after in?

+ 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