+ Reply to Thread
Results 1 to 4 of 4

Differentiate each set of duplicates with different fill color

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Differentiate each set of duplicates with different fill color

    Excel 2007
    I have a list of values containing multiple sets of duplicates. I want to format each set of duplicates with a random color and leave the unique values alone.

    Desired Result:
    Capture.PNG

    Ex.
    apple
    orange
    banana
    apple
    pear
    grape
    grape

    the fill color for both apples would be purple
    orange, banana, pear would be left alone
    the fill color for both grapes would be brown



    Currently, I'm using the code below which stores all values in a dictionary and assigns each a color, making sure to add a value to the dictionary only once. This assigns a color to the unique values, however.


    I coupled the code with a conditional format to find all the unique values and set them to "no fill" but this interfered with my alternating row colors in the table.

    Code originally from: http://stackoverflow.com/questions/1...alues-in-excel


    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Differentiate each set of duplicates with different fill color

    try this code (select the column where you check for duplicates and run the macro)
    Please Login or Register  to view this content.
    Click on the star if you think I helped you

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Differentiate each set of duplicates with different fill color

    Great! Thank you. It works, but only if the data is formatted as range, rather than table, which is what I need. What modifications do I need to make in order for this code to function within a table?

    I really appreciate your help!

  4. #4
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Differentiate each set of duplicates with different fill color

    try this one (replace Table1 with the table name, and Column1 with the column name):
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Fill Color for Duplicates Across all Sheets in Workbook in Column A
    By mikemorabito in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2014, 01:26 PM
  2. [SOLVED]Fill Color (highlight cells) but not to print fill color
    By itszille in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-24-2012, 05:37 PM
  3. Find a duplicate and then use the duplicates interior.color to change cell color.
    By bopsgtir in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-01-2012, 03:54 PM
  4. [SOLVED] Color dupe rows but differentiate
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-04-2012, 01:25 PM
  5. Replies: 0
    Last Post: 04-06-2009, 04:07 PM

Tags for this Thread

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