+ Reply to Thread
Results 1 to 8 of 8

Code to find duplicate colors and keep only 1 entry

  1. #1
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Code to find duplicate colors and keep only 1 entry

    Assume I have a data in Column A (Rows 1:500) where I have given certain colors to different entries in column A.

    However, when I run the code, I want entries with similar colors to get deleted except only one entry of its kind.

    Is there a way I can achieve that?
    Cheers!
    Deep Dave

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Code to find duplicate colors and keep only 1 entry

    Can your column A or your data be sorted?
    Is there room for temporary data in column B or any other column?
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Code to find duplicate colors and keep only 1 entry

    This macro will put color of cells in column A into column B.
    It then sort those 2 columns and delete all similar color but the first cell.
    It then delete column 2.
    If you have data past columns B, change the sort range A1:B500 to suit your data.
    Please Login or Register  to view this content.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Code to find duplicate colors and keep only 1 entry

    If this is not what you wanted, need to see your file with before/after format.
    Please Login or Register  to view this content.

  5. #5
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Code to find duplicate colors and keep only 1 entry

    @ p24leclerc
    Hey!! Thank you for the code. It worked!!

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Code to find duplicate colors and keep only 1 entry

    @jindon

    Thank you for the code.. The code was perfect and extremely fast..

    Just 1 query, can this be done to duplicate text or numbers too instead of duplicate colors???

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Code to find duplicate colors and keep only 1 entry

    Try chage
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Code to find duplicate colors and keep only 1 entry

    Done!!

    Thanx a ton..

+ 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