+ Reply to Thread
Results 1 to 5 of 5

Need Macro which identifies duplicates in a column and colors the duplicate values

  1. #1
    Registered User
    Join Date
    12-10-2011
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    56

    Need Macro which identifies duplicates in a column and colors the duplicate values

    Hi All,

    I need a macro which should identify the duplicate values in a column in excel and either return a message box with total number of duplicates or color the duplicate values in that particular column.

    I have attached the sample worksheet.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Need Macro which identifies duplicates in a column and colors the duplicate values

    If you just want to colour the cells then you don't need a macro, you can use conditional formatting with a formula of:

    =COUNTIF(A:A,A1)>1
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-10-2011
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: Need Macro which identifies duplicates in a column and colors the duplicate values

    Quote Originally Posted by Andrew-R View Post
    If you just want to colour the cells then you don't need a macro, you can use conditional formatting with a formula of:

    =COUNTIF(A:A,A1)>1
    Thanks for the Clarification, however is it possible to include that formula in a VBA code ?

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

    Re: Need Macro which identifies duplicates in a column and colors the duplicate values

    You can actually use Data validation to prevent duplicates.

    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  5. #5
    Banned User!
    Join Date
    06-13-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need Macro which identifies duplicates in a column and colors the duplicate values

    Please Login or Register  to view this content.
    Last edited by royUK; 04-08-2012 at 03:28 AM.

+ 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