Consulting

Results 1 to 7 of 7

Thread: Solved: Column Values Duplicate

  1. #1
    VBAX Contributor
    Joined
    Feb 2009
    Posts
    103
    Location

    Post Solved: Column Values Duplicate

    Hi guys, this might be a common problem...but how to detect duplicate values in a single column and change the color of the duplicata data, to indicate that it's a duplicated value?

    thanks...

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Use conditional formatting with a formula of

    =COUNTIF($A$1:A1,A1)>1
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Contributor
    Joined
    Feb 2009
    Posts
    103
    Location
    hi xld, thanks...how to use countif formula to a macro statement?


  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why VBA, Conditional formatting does it all.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Contributor
    Joined
    Feb 2009
    Posts
    103
    Location

    Smile

    thanks xld, why i want vba because i want to put a color on the cell which is duplicated... anyway thank you so much for your help...

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    That is what CF does in the manner I showed you.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    If you want all duplicates marked including the original instance, use CF with
    =COUNTIF($A:$A,A1)>1
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •