+ Reply to Thread
Results 1 to 6 of 6

Change cell format (cell color+font color) based on color of another cell

  1. #1
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Change cell format (cell color+font color) based on color of another cell

    Hi all,

    I am in need of solution to my problem i have been struggling with for quite some time now.

    I have a range off cells that have numbers in them, and are colored with different colors. These cells don't always have the same color. The range of cells is F20:AU42.

    I have made 13 check boxes which are bounded to different cells. Range of cells is E3:E15. Every cell in that range has a different color and these colors are the same colors I use in above mentioned range F20:AU42.

    here is the picture of the workbook so you can see what I am working on.

    Capture.JPG

    What i need is, the vba code that format cells in range F20:AU42 when i uncheck the checkboxes in range E3:E15.
    For instance. If I uncheck the checkbox in cell E3 (color orange), I would like to format all cells with orange in range F20:AU42 (cell color white+font color white).
    And if I check the checkbox again it will change the color of same cells to orange.

    I hope that someone out there can help me with this.

    Best regards
    Dedaluss

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,180

    Re: Change cell format (cell color+font color) based on color of another cell

    Please include the workbook, it will make it easier to get on with the project.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Change cell format (cell color+font color) based on color of another cell

    Hi dflak,

    Here is the sample workbook. I hope that you have all information needed.

    Best regards
    Dedaluss
    Attached Files Attached Files

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    10,028

    Re: Change cell format (cell color+font color) based on color of another cell

    Perhaps something like this: this is for Check Box 1 only
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  5. #5
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,180

    Re: Change cell format (cell color+font color) based on color of another cell

    I filled rows 1 and 2 with black so I can see what the contents of the cells are. I added a "helper" row that gets the colors associated with the check boxes and stores the color number as a long. You can unfill the cells to hide the values.

    The program also uses a helper sheet called Remember - this sheet can be hidden. When you clear a certain color on the chart, the program goes through the F20:AU42 range and "remembers" the color associated with the cell. When you turn that color back on, the program fetches the color value from the remember sheet and applies it to the cell.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-23-2014
    Location
    Hjørring, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Change cell format (cell color+font color) based on color of another cell

    Hi all,

    I am very sorry for my late reply, but I was away for last couple of weeks. Now that I am back, i would like to thank you both Sintek and Dflak for a good work. I had to go with Dflaks code because the code is fully integrated in the file. So reputation goes to Dflak.

    Again big thanks to you.

    Best regards
    Dedalus

+ 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. Change a Range's cell background color to that of another cell's cond. format color
    By kamelkid2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2014, 12:57 PM
  2. Macro to change cell text color based on darkness of cell fill color
    By cincyshirm61 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2014, 12:11 PM
  3. Mouse rolls over to cell will change the tab color, font color and tp bold type
    By Rocky2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-20-2013, 10:36 AM
  4. Change Font Color Based On Adjacent Cell Color
    By Zorro9758 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2013, 02:47 PM
  5. Change font color based on font color of another cell
    By Ibyers in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2012, 09:36 AM
  6. Change font color if cell color become yellow (6)
    By unley in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2009, 05:31 PM
  7. [SOLVED] How to change the default Border, Font Color, and Cell Color
    By Elijah in forum Excel General
    Replies: 3
    Last Post: 11-02-2005, 07:55 PM

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