+ Reply to Thread
Results 1 to 5 of 5

macro to compare columns and highlight common rows

  1. #1
    Registered User
    Join Date
    12-17-2010
    Location
    philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    macro to compare columns and highlight common rows

    I don't think this is a very hard macro to write but i haven't used VB very much and just now learning again. Bascially I need to write a macro that compares account numbers in columns from two different worksheets. If an account number is in both columns I would like to highlight the whole row on both worksheets. I am thinking after it is done it shouldn't be hard to sort by highlighted rows if I am correct. I basically need to find out which accounts are on both worksheets and which ones aren't if someone knows of a simpler way to do this.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: macro to compare columns and highlight common rows

    please post dummy workbook, 5 rows of data will be enough on each sheet (sensitive data can be changed for anything else)

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: macro to compare columns and highlight common rows

    Which column....whats the worksheet names. A copy of your workbook or test workbook would help a lot.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: macro to compare columns and highlight common rows

    Hi jagman,

    Find the attached with two sheets and a "Match?" column on each showing if there is a match on the other sheet. I hope this works for you.
    Attached Files Attached Files
    Last edited by MarvinP; 12-22-2010 at 11:27 AM. Reason: Need older xls file to attach.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    12-17-2010
    Location
    philadelphia, PA
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: macro to compare columns and highlight common rows

    Thank you MarvinP! That worked perfectly and was very simple.

+ 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