+ Reply to Thread
Results 1 to 3 of 3

Change text colour of duplicates to white for a range of columns

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    SG
    MS-Off Ver
    Excel 2007
    Posts
    37

    Change text colour of duplicates to white for a range of columns

    Hello all,

    I am stuck again at another part of my big macro. This current step is to change the text colour of some duplicated cells to white colour. The target duplicated items are in Column A:C.

    Illustration:
    Employee A & his data may be repeated a few times in the database because he's attended a various no. of courses. I would therefore want his repeated data (i.e. his name, department & job title) to be coloured white. Another employee, Employee B (cell A6) can also be holding the same job title & in the same department as Employee A but the macro cannot change change his data white because there is only 1 set of data for this employee. Continuing on, Employee C also has some duplicated data as he's attended 2 courses. Similar to Employee A, I would want his duplicated name, department & job title coloured white.

    Problem:
    The current macro I've is able to change the colour of duplicated data to white but it only works for column A and I do not know how to extend it till column C. In addition, if I merely copy and modify the code to suit column B & C, all the duplicated items will be coloured white (i.e. in column B I'll only see 1 set of department A, and column C, only 1 set of Job A).

    Current code is:
    Please Login or Register  to view this content.

    A sample data is attached for your reference. Will appreciate any help given. Thanks.



    kayoke
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Change text colour of duplicates to white for a range of columns

    Hello,

    You can format your duplicates in Column C, via conditional formatting, by adding this code to your macro. Conditional Formatting code runs really fast. The following code assumes that you want your duplicates in white text, and your uniques in black text.

    Please Login or Register  to view this content.
    Last edited by KSSLR; 06-26-2012 at 12:35 PM.

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    SG
    MS-Off Ver
    Excel 2007
    Posts
    37

    Re: Change text colour of duplicates to white for a range of columns

    Hmm, the codes change everything to white text. I cannot have cells C2, C6, & C8 in white text cause this is the first time the data is appearig for the respective employees. The macro thus needs to capture this for the rest of the employees that I'm going to enter into my final database.

+ 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