+ Reply to Thread
Results 1 to 4 of 4

Automatic color based on color in other cell

  1. #1
    Registered User
    Join Date
    04-23-2012
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    24

    Automatic color based on color in other cell

    Hi everyone,

    I am working an a schedule for our employees that contains a lot of colors. I am looking for a way to automatically fill certain cells by formula. The list is long so conditional formatting would not really work. Or maybe with the correct formula. If possible I would like to avoid Macro or VBA. Please find my problem below:

    In column A: the names of the employees
    In column B: The corresponding colours
    In column F: The hours when who is working
    In column G: The employee who is working during the defined hoursFormatting colors.xls

    It would be great if there is a way that a formula does the following: Based on the name in In column A, and the corresponding color in In column B, the name in G recieves automatically the fill color as defined in In column B. In the attachment the exel file with a small sample. Our list of employees contains over 300 with all different colors. Putting them in manually in conditional formatting would be a huge workload. In the tap "Problem" it is show how it is and in the tab "Solving" how it should become (automatically).

    Any help is highly appreciated.

    Best regards,
    Bram

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Automatic color based on color in other cell

    Rule of Excel it appears no one has brought to you before... Color is not data. Colors are for quick human reference by eye. In Excel, use actual data to flag data in a way that Excel can use quickly. Then convert your results to colors if you really need that.

    Having looked more carefully, I would employ VBA to accomplish what you're doing. IS VBA ok?
    Last edited by JBeaucaire; 05-22-2013 at 04:44 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Automatic color based on color in other cell

    If VBA is ok, this macro will do what you've asked.

    1) Right-click on the sheet tab name and select VIEW CODE

    2) Insert this macro into the sheet module that appears:
    Please Login or Register  to view this content.
    3) Close the VBA editor and save your workbook.

    4) Now any changes in column G will trigger a name check in column A. If the name is found the adjacent color is copied onto the cell you just edited.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,049

    Re: Automatic color based on color in other cell

    Jerry, I gotta remember how you phrase that (post #2) for future reference
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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