+ Reply to Thread
Results 1 to 5 of 5

Change font color if cell color become yellow (6)

  1. #1
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Change font color if cell color become yellow (6)

    Hi all, at the moment, I have font color white in blank cells in column E and I (from row 5 to row 245) so the visitors will not see the text.

    If any of these cells become yellow (color code is 6), the font color will become black so visitors can see the text alot far better than white.

    I've tried this code myself after this post but nothing happen

    Please Login or Register  to view this content.
    The reason why I wanted this is because the other cells in other columns has red and green color background and it's easy to see white text, but it's hard to see white text with yellow background, hope this make sense, thank you.

    Test.xls
    Last edited by unley; 07-12-2009 at 05:31 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    06-17-2009
    Location
    Chennai,India
    MS-Off Ver
    Excel 2003,excel 2007
    Posts
    678

    Re: Change font color if cell color become yellow (6)

    instead of change use selection change.

    try this event codeand post feedback

    Please Login or Register  to view this content.
    By the by even if you made the font white can the user not see the value in the formula box.

  3. #3
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: Change font color if cell color become yellow (6)

    Thank you ventkat1926 for replying. It works great only when click on yellow cells to make text black.

    Sometime when I highlight two or more cells at once like D19 & E19, a Runtime Error '13' on

    If Target = ""
    Can there be anything in code to get around this?

    Thank you.

  4. #4
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770

    Re: Change font color if cell color become yellow (6)

    This isn't ideal, as you will still need to move to somewhere else on the sheet for the font color to be applied, but it does mean you don't have to click on the particular cell to change it's font color, and also it won't give you range errors.
    I'm not sure how you would detect the Interior.Color change event, which is what you really want to be doing.

    Please Login or Register  to view this content.
    If you find the response helpful please click the scales in the blue bar above and rate it
    If you don't like the response, don't bother with the scales, they are not for you

  5. #5
    Forum Contributor unley's Avatar
    Join Date
    11-27-2008
    Location
    South Australia
    MS-Off Ver
    MS Office 2007
    Posts
    253

    Re: Change font color if cell color become yellow (6)

    Thank you Phil_V.
    I've created Project Report for others where whenever they click on the red,yellow or green objects (red is bad report, yellow is ok and green is good report) the color automatically fill in the cells in the "Report" sheet to show the reports.
    So I had to fill in cells with white fonts so they cannot see the percentage of the project in blank cells "Report" sheet, only for the color cells when their background changed color.
    But yellow is the worse color to see white text and that's why I wanted to change white text to black in yellow cells.

    Unfortunetely, your code works almost the same as venkat1926 where I have to click on yellow cells to make text black.
    So thank you Phil_V & venkat1926 for replying and giving me some nice ideas, cheers.
    Last edited by unley; 07-12-2009 at 05:46 PM.

+ 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