+ Reply to Thread
Results 1 to 11 of 11

Highlight cells if duplicate found on the same row

  1. #1
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Highlight cells if duplicate found on the same row

    I have no idea how to even start this macro but i will like the macro to find duplicate with thin the same row and highlight it i have done with conditional formatting but the spreadsheet is about 3000 rows excel performance is super slow if anybody has a macro out there i will really appreciate thanks
    Attached Files Attached Files
    Last edited by martinez_pedro; 08-17-2009 at 02:05 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Highlight cells if duplicate found on the same row

    You don't need VBA, use Conditional Formatting
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Re: Highlight cells if duplicate found on the same row

    I will like to do it with a macro because excel performance is not so slow
    conditional formatting takes all my excel resources

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Highlight cells if duplicate found on the same row

    martinez_pedro,

    Based on your example workbook, your are looking to highlite duplicates of values in column A in each respective row.

    See the attached workbook "Highlight cells if duplicate found on the same row - EXAMPLE(1) - martinez_pedro - VP rows - SDG10.xls" with macro "FindMatches".

    Detach the workbook and run the "FindMatches" macro on Sheet1.

    The macro will run in Excel 2003 and 2007.
    Last edited by stanleydgromjr; 08-12-2009 at 05:28 PM.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  5. #5
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Re: Highlight cells if duplicate found on the same row

    hey stan thanks for the help i guess my exemple wasnt very clear but
    let me described in another words
    So let say on sheet1
    On row 2 cell a2 and cell f2 is a match then highlights a2&f2
    On row 3 cell b3 and cell d3 is a match then highlights b3&d3
    On row 4 cell z4and cell aa4 is a match then highlight z4&aa4
    On row 5 cell f5 and cell h5 is a match then highlights f5&h5
    On row 6 cell i6 and cell q6 is a match then highlights i6&q6
    The matching cells can be anywhere on the row and blank cell needs to exclude it for highlighting

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Highlight cells if duplicate found on the same row

    martinez_pedro,

    How about another sample workbook with raw data (say 10 rows) on Sheet1, and on Sheet2 what the results should be.

    What if you have on one row two different sets of two cells or more?

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Highlight cells if duplicate found on the same row

    Hello martinez_pedro,

    I have added the following macro to the attached workbook. There is an example on "Sheet2". A button has been added to run the macro.

    The macro assumes the first row contain column headers and there are no empty rows in the table. Empty cells are not marked as duplicates.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    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!)

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Highlight cells if duplicate found on the same row

    Leith Ross,

    Nicely done.

  9. #9
    Registered User
    Join Date
    08-10-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Highlight cells if duplicate found on the same row

    This code must help in almost every worksheet

    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    09-29-2008
    Location
    usa
    MS-Off Ver
    EXCEL 2010
    Posts
    116

    Smile Re: Highlight cells if duplicate found on the same row

    Excellent work (satswid, Leith Ross, stanleydgromjr, royUK) both of this macros works really good thank you, you all save a lot of time

  11. #11
    Registered User
    Join Date
    11-03-2010
    Location
    india
    MS-Off Ver
    Excel 2010
    Posts
    29

    Unhappy Re: Highlight cells if duplicate found on the same row

    Quote Originally Posted by satswid View Post
    This code must help in almost every worksheet

    Please Login or Register  to view this content.
    When i am using the code i am getting a error "Type Mismatch"

    can any one solve this issue

+ 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